将SQL查询更改为LINQ

时间:2016-04-13 18:55:09

标签: entity-framework sql-to-linq-conversion

我如何转换此SQL查询:

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" + "'"

进入LINQ

1 个答案:

答案 0 :(得分:0)

你可以尝试类似的东西:

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