开发者

LINQ to NHibernate and let keyword

开发者 https://www.devze.com 2023-01-22 20:55 出处:网络
Is this possible to use let keyword with nhibernate linq? I wrote var posts = from post in postsRepository.GetPosts(name)

Is this possible to use let keyword with nhibernate linq? I wrote

 var posts = from post in postsRepository.GetPosts(name)
             let commentsCount = (from c in NHUnitOfWork.Curre开发者_运维技巧ntSession.Linq<Comment>()
                                  where c.Post.ID == post.ID
                                  select c).Count()
             select new ...

and in response I have

NHibernate.QueryException: could not resolve property: post of: Sys.Domain.Entities.Post


Something wrong with mapping of Comment.Post

0

精彩评论

暂无评论...
验证码 换一张
取 消