Cannot convert expression type 'NHibernate.IQu

2019-07-10 00:31发布

I'm sure I'm doing this wrong, but I've been picking at it for a while. I'm trying to implement an IRepository Find method, and I just can't seem to work out how. Any help would be greatly appreciated!

The following code gives me the red squiggly line with the error message posted as the question.

   IQueryable<T> IRepository<T>.Find(Expression<Func<T, bool>> predicate)
    {
        return sessionManager.OpenSession().QueryOver<T>().Where(predicate);
    }

1条回答
等我变得足够好
2楼-- · 2019-07-10 00:53

You have to use .Query<T>() extension method instead.

查看更多
登录 后发表回答