2010-10-29 8 views
6

È possibile utilizzare let parola chiave con nibernate linq? Ho scrittoLINQ a NHibernate e let keyword

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

e in risposta ho

NHibernate.QueryException: impossibile risolvere proprietà: carica di: Sys.Domain.Entities.Post

+0

Presumibilmente il tuo commento è collegato al tuo post? non potresti usare un operatore di gruppo? –

risposta

0

qualcosa che non va con la mappatura di Comment.Post