LINQ to NHibernate并让关键字

lku*_*ylo 6 .net c# linq nhibernate linq-to-nhibernate

这是否可以使用带有nhibernate linq的let关键字?我写

 var posts = from post in postsRepository.GetPosts(name)
             let commentsCount = (from c in NHUnitOfWork.CurrentSession.Linq<Comment>()
                                  where c.Post.ID == post.ID
                                  select c).Count()
             select new ...
Run Code Online (Sandbox Code Playgroud)

作为回应我有

NHibernate.QueryException:无法解析属性:post:Sys.Domain.Entities.Post

aba*_*hev 0

映射有问题Comment.Post