Home > Enterprise >  EF Lambda for SQL : How to get a new column based on some string presence in other column of the sam
EF Lambda for SQL : How to get a new column based on some string presence in other column of the sam

Time:10-20

I want SQL query equivalent in EF Core Lambda, to get an extra column as either true or false, based on some substring(in this case DEALER) if present in other column's data of the same table.

myTable
     Id                        col1
     1              I have substring - DEALER
     2              I do not have any substring 

I need the output as

Id,                IsDealer
1,                  true   
2,                  false   

I tried the following SQL query,

SELECT [Id] , 
CASE WHEN [col1] LIKE '           
  • Related