C# LINQ到NHibernate和let关键字
可以将let关键字与nhibernate linq一起使用吗? 我写C# LINQ到NHibernate和let关键字,c#,.net,linq,nhibernate,linq-to-nhibernate,C#,.net,Linq,Nhibernate,Linq To Nhibernate,可以将let关键字与nhibernate linq一起使用吗? 我写 var posts=来自postsrespository.GetPosts(名称)中的post 让CommentScont=(来自NHUnitOfWork.CurrentSession.Linq()中的c) 其中c.Post.ID==Post.ID 选择c.Count() 选择新的。。。 作为回应,我有 NHibernate.QueryException:无法解析的属性:post of:Sys.Domain.Entities
var posts=来自postsrespository.GetPosts(名称)中的post
让CommentScont=(来自NHUnitOfWork.CurrentSession.Linq()中的c)
其中c.Post.ID==Post.ID
选择c.Count()
选择新的。。。
作为回应,我有
NHibernate.QueryException:无法解析的属性:post of:Sys.Domain.Entities.post
评论的映射有问题。Post
您的评论可能链接到了您的帖子?你不能用分组接线员吗?
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 ...