Nhibernate was unable to resolve the property (only in Visual Studio 2015) using LeftOuterJoin

I need help because it is impossible to explain. We have a semi-component nhibernate request:

var query = _tyreRepository.Session.QueryOver<Tyre>(() => tyreAlias) .JoinQueryOver<Pattern>(() => tyreAlias.Pattern, () => patternAlias) .JoinQueryOver<Brand>(() => patternAlias.Brand, () => brandAlias) .JoinQueryOver<RimSize>(() => tyreAlias.RimSize, () => rimSizeAlias) .JoinQueryOver(() => tyreAlias.SpeedIndex, () => speedIndexAlias, JoinType.LeftOuterJoin); 

What works great in Visual Studio 2012, we recently upgraded to Visual 2015, and now this request does not work; when you use where on the speed index:

 query.Where(() => speedIndexAlias.SpeedKm >= speedKms); 

Otherwise, the request works fine.

The worked out debug backtracking code didn’t work. Then we got the same project as in visual studio 2012, they work fine. We cannot understand why, when compiling a project in visual studio 2015, this request no longer works (without any changes to the request).

I really like all the new language changes in 2015, but our site breaks when we compile our code in visual studio 2015 ...

+5
source share
1 answer

Ok, I found a solution. You need to upgrade nhibernate to the latest version due to a problem with the C # Roslyn compiler in visual studio 2015. Unfortunately, it doesn't seem like older versions of nhibernate have a fix for this at all.

https://nhibernate.jira.com/browse/NH-3795

So, if you want to use visual studio 2015 and you are using nhibernate, you need to update nhibernate now. 4.04.4000 should be built, which I can confirm, works with smooth 2.0.3.

+4
source

Source: https://habr.com/ru/post/1233824/


All Articles