The specified type member ‘Date’ is not supported in LINQ to Entities Exception

You can use the TruncateTime method of the EntityFunctions to achieve a correct translations of the Date property into SQL: using System.Data.Objects; // you need this namespace for EntityFunctions // … DateTime ruleData = Convert.ToDateTime(rule.data).Date; return jobdescriptions .Where(j => EntityFunctions.TruncateTime(j.JobDeadline) == ruleData); Update: EntityFunctionsis deprecated in EF6, Use DbFunctions.TruncateTime

LINQ to Entities does not recognize the method ‘System.String Format(System.String, System.Object, System.Object)’

Entity Framework is trying to execute your projection on the SQL side, where there is no equivalent to string.Format. Use AsEnumerable() to force evaluation of that part with Linq to Objects. Based on the previous answer I have given you I would restructure your query like this: int statusReceived = (int)InvoiceStatuses.Received; var areaIds = user.Areas.Select(x=> … Read more

“A lambda expression with a statement body cannot be converted to an expression tree”

Is objects a Linq-To-SQL database context? In which case, you can only use simple expressions to the right of the => operator. The reason is, these expressions are not executed, but are converted to SQL to be executed against the database. Try this Arr[] myArray = objects.Select(o => new Obj() { Var1 = o.someVar, Var2 … Read more

The specified type member is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported

You cannot use properties that are not mapped to a database column in a Where expression. You must build the expression based on mapped properties, like: var date = DateTime.Now.AddYears(-from); result = result.Where(p => date >= p.DOB); // you don’t need `AsQueryable()` here because result is an `IQueryable` anyway As a replacement for your not … Read more