I have entity framework code as shown below.I am getting following error in where condition.
Cannot convert lambda expression to type \'bool\' because
In asp mvc Razor while i tried:
@if (modelItem => item.Id == 1) { Approved }
Cannot convert lambda expression to type 'bool' because it is not a delegate type
Solution:
@if (Model.FirstOrDefault().Id == 1) { Approved }
Hope helps someone.