我试图执行以下代码,但是收到了一个错误。
我收到的错误信息是"The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported." 我试过将所有内容转换为字符串,只比较日期部分,但似乎无法找到正确的组合方式。非常感谢您的帮助。
public List<Log> GetLoggingData(DateTime LogDate, string title)
{
var context = new LoggingEntities();
var query = from t in context.Logs
where t.Title == title
&& t.Timestamp == LogDate
select t;
return query.ToList();
}
我收到的错误信息是"The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported." 我试过将所有内容转换为字符串,只比较日期部分,但似乎无法找到正确的组合方式。非常感谢您的帮助。