This is my scenario:
public IEnumerable<ISuperMerc> getSuperMercTree(string IDLanguage)
{
SuperMercModel SMer = null;
SuperMercDescriptionModel descrSMer = null;
MercModel Merc = null;
MercDescriptionModel descrMerc = null;
var qOver = _HibSession.QueryOver<SuperMercModel>(() => SMer)
.JoinAlias(() => SMer.DescriptionsSM, () => descrSMer,JoinType.LeftOuterJoin)
.Where(() => descrSMer.IDLanguage == IDLanguage)
.JoinAlias(() => SMer.Merc, () => Merc,JoinType.LeftOuterJoin)
.JoinAlias(() => Merc.DescriptionsMer, () => descrMerc,JoinType.LeftOuterJoin)
.Where(() => descrMerc.IDLanguage == IDLanguage)
.OrderByAlias(() => SMer.ID).Asc
.ThenByAlias(() => descrMerc.Description).Asc
.Future<SuperMercModel>();
return qOver;
}
I've encountered the following error
could not resolve property: Description of: SuperMercModel
It's strange, the Description field is in the MercDescriptionModel class not in the SuperMercModel class.
I'm using aliases to create a multiple-join and multiple-order-by query.