Search code examples
entity-frameworksql-to-linq-conversion

Change sql query to LINQ


How I convert this sql query :

Select ID, first_name, last_name, phone_number, room_type, room_floor, room_number, break_fast, lunch, dinner, cleaning, towel, s_surprise, supply_status, food_bill
from reservation
where check_in = '" + "True" + "' AND supply_status= '" + "False" + "'"

into LINQ


Solution

  • You can try something similar to this:

    var rows = from r in reservation
               where r.check_in == "True" && r.supply_status == "False"
               select r;