I have the following method inside my asp.net mvc web application :-
public SystemInformation GetSystemInfo(int pagesize)
{
var d = DateTime.Today;
SystemInformation s = new SystemInformation()
{
DeleteNo = tms.TechnologyAudits.Where(a => (EntityFunctions.TruncateTime(a.DateTimeEnd.Date) == EntityFunctions.TruncateTime(d) && a.AuditAction.Name.ToLower() == "delete")).Count(),
};
return s;
}
But the above is raising the following exception:-
The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.