2010-10-29 36 views
6

这是可能的使用let关键字与nhibernate linq? 我写LINQ到NHibernate,让关键字

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 ... 

,并响应我有

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

+0

想必您的评论与您的​​帖子相关联?你不能使用组运营商吗? – 2010-11-04 09:26:53

回答