Hi, I'm wondering how I can represent the following in the criteria API
return DataContext.Session.CreateQuery("
select
ss.PracticeArea
from Subsection as ss
where ss.Location = :Location
")
.SetEntity("Location", location)
.List<PracticeArea>();
The where clause is straight forward enough the bit I'm tripping over is how to get the joined object as the result ?
DataContext.Session.CreateCriteria<Subsection>()
.Add(Restrictions.Eq("Location", location))
.List<PracticeArea>();
This is my attempt which doesnt work since it returns the wrong type.