Entity Framework - Cannot convert lambda expression to type 'string' because it is not a delegate type

For those interested in the outcome:
I was missing a simple Using statement at the head of my code.

using System.Linq;

This fixed it right up.


In my case it was missing

using System.Data.Entity;


using System.Linq;
using System.Data.Entity;

In my case, I had the

Using System.Linq;

but I was missing the && after a where clause item.

Bad Code:

item.Group.ID == grp.ID
p.Product_Status_Flag == 1 &&
item.Valid

Correct Code ( with no error ):

item.Group.ID == grp.ID && // <- This was missing and I didn't see it right away.
p.Product_Status_Flag == 1 &&
item.Valid

I hope this saves someone some time.


I was struggling with this in a Telerik Grid template within a Razor view for about an hour. In my case, this:

columns.Bound(x => x.ID).Template(@<text><a href="@(Model.AppUrl + AdditionalFeeTypes/Details/" + item.ID)">@item.ID</a></text>);

was supposed to be this:

columns.Bound(x => x.Id).Template(@<text><a href="@(Model.AppUrl + AdditionalFeeTypes/Details/" + item.Id)">@item.Id</a></text>);

The case on "Id" was wrong! I hope this helps someone. You might be getting this error just because you put a non-existent property!