[1618] R# doesn't suggest using NHibernate.LambdaExtensions and bugs with intellisense

NHibernate.LambdaExtensions has extension methods for the CreateCriteria method in NHibernate instead of it being dependent on string, string that the method signature is CreateCriteria<T>(this NHibernate.Criterion.DetachedCriteria, System.Linq.Expressions.Expression<System.Func<T,object>>)

Which allows you to create code like

DetachedCriteria.For<BizServ>()
                .CreateCriteria<BizServ>(x => x.County)
                .CreateCriteria<County>(x => x.Id)
                .Add<County>(x => x.Id == county.Id);


If I don't manually add the using NHibernate.LambdaExtensions; R# won't see that .CreateCriteria<BizServ>(x => x.County) is a valid method it only sees CreateCriteria(string, string) the other problem is inside the lambda expression there doing x. (x DOT)  displays nothing and I have no intellisense support inside these lambdas.

1 comment
Comment actions Permalink

I see the same behavior when updating object collections to generic
collections. For whatever reason, it doesn't recognize that List wrote in message
news:8915493.137241268663291310.JavaMail.clearspace@app8.labs.intellij.net...

NHibernate.LambdaExtensions has extension methods for the CreateCriteria
method in NHibernate instead of it being dependent on string, string that
the method signature is CreateCriteria<T>(this
NHibernate.Criterion.DetachedCriteria,
System.Linq.Expressions.Expression<System.Func<T,object>>)

>

Which allows you to create code like

>

DetachedCriteria.For<BizServ>()
                .CreateCriteria<BizServ>(x => x.County)
                .CreateCriteria<County>(x => x.Id)
                .Add<County>(x => x.Id == county.Id);

>
>

If I don't manually add the using NHibernate.LambdaExtensions; R# won't
see that .CreateCriteria<BizServ>(x => x.County) is a valid method it only
sees CreateCriteria(string, string) the other problem is inside the lambda
expression there doing x. (x DOT)  displays nothing and I have no
intellisense support inside these lambdas.

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5258601#5258601


0

Please sign in to leave a comment.