That worked great. However instead of this:
object result = Session.CreateCriteria<CbtEssay>().
Add(Expression.Eq("Esexamdt", examDate)).
SetProjection(Projections.ProjectionList().
Add(Projections.GroupProperty("Esregid")).
Add(Projections.GroupProperty("Esid"))).List();
I wanted to just directly map it to my object like this:
IList<RegistrantEssays> result =
Session.CreateCriteria<CbtEssay>().
Add(Expression.Eq("Esexamdt", examDate)).
SetProjection(Projections.ProjectionList().
Add(Projections.GroupProperty("Esregid")).
Add(Projections.GroupProperty("Esid"))).
SetResultTransformer(Transformers.AliasToBean(typeof(RegistrantEssays))).List<RegistrantEssays>();
But it's not working. Any idea how to get data to return without
using a plain "object" and have it automatically map to my
RegistrantEssays class?
On Feb 2, 11:13 am, Wolli <[email protected]> wrote:
> If you want to use more than one projection, you need a projection
> list:
>
> criteria.SetProjection( Projections.ProjectionList()
> .Add(Projections.GroupProperty("Esregid")
> .Add(Projections.GroupProperty("Esid"))
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.