Hi all,
In the docs there is this code:
Code:
IList results = session.CreateCriteria(typeof(DomesticCat), "cat")
.CreateAlias("kittens", "kit")
.SetProjection( Projections.ProjectionList()
.Add( Projections.Property("cat.Name"), "catName" )
.Add( Projections.Property("kit.Name"), "kitName" )
)
.AddOrder( Order.Asc("catName") )
.AddOrder( Order.Asc("kitName") )
.List();
Should it be possible to remove the alias on kittens and refer to kittens.name?
ie:
Code:
IList results = session.CreateCriteria(typeof(DomesticCat), "cat")
.SetProjection( Projections.ProjectionList()
.Add( Projections.Property("cat.Name"), "catName" )
.Add( Projections.Property("kittens.Name"), "kitName" )
)
.AddOrder( Order.Asc("catName") )
.AddOrder( Order.Asc("kitName") )
.List();
When I try the second code example without the alias I receive the following error:
Code:
could not resolve property: kittens.Name of: TestStuff.DomesticCat
thanks.