Anele Ngqandu

Anele Ngqandu

  • 1.3k
  • 429
  • 28.2k

What am missing in my Dapper query

Mar 26 2022 8:10 AM

Kindly assist, I am getting error "FROM keyword not found where expected" query below. What am I missing?

string sql = "select NAME as name, " +
                        "CASE WHEN UPPER(OFFERING) LIKE '%' || :Offering || '%' THEN 'Part Time' ELSE 'Full Time' END PROPOSED_OFFERING " +
                        "FROM  MYTABLENAME WHERE SURNAME =:Surname";

                        var results = await connection.QueryAsync<PersonDto>(sql, new { Offering = "FULL TIME", Surname = "Doe" });
                        if (!results.Any())
                            return new List<PersonDto>();

 

 


Answers (1)