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

Leave a Comment