Class A
{
Guid ID{get;}
ISet<B> ClassBs {get;}
}
repository
public IList<B> GetAsBs(A a)
{
ICriteria ACriteria = Session.CreateCriteria(typeof(A));
ICriteria BCriteria = ACriteria.CreateCriteria("ClassBs");
A.Add(Restrictions.Eq("ID", a.ID));
return BCriteria.List<B>();
}
I can accomplish this in HQL np but want to use criteria i am getting an error that it is trying to return A not B
any help would be great