我得到了这个异常,有什么想法可以解决吗?我知道它很愚蠢,但似乎无法弄清楚。
不支持表达式类型:
System.Linq.Expressions.InstanceMethodCallExpressionN
public static IQueryable<T> GetBy<T>(Expression<Func<T, bool>> predicate)
{
try
{
IDocumentSession RavenSession = MvcApplication.Store.OpenSession();
var t = RavenSession.Query<T>().Where(predicate);
RavenSession.Dispose();
//return t.AsQueryable<T>();
return t;
}
catch (Exception e)
{
throw e;
}
}
var r = DB.GetBy<Docs>(x => x.Id == Id).FirstOrDefault(); <-- this is where I get the exception