LINQ to NHibernate and let keyword
Asked Answered
I

1

6

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

Ivett answered 29/10, 2010 at 21:3 Comment(1)
Presumably your comment is linked to your post? couldn't you use a group operator?Agnail
G
0

Something wrong with mapping of Comment.Post

Gwenore answered 11/3, 2011 at 9:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.