School boy error.
The GetTypes method on of the projection should return the types
involved in the result of the projection. I was returning the types of
the fields involved.
Should look like this:
public override IType[] GetTypes(ICriteria criteria,
ICriteriaQuery criteriaQuery) { return new IType[]
{ NHibernateUtil.Int32 }; }
Hope this saves someone some time...
I have also implemented this in a different way. Perhaps a discussion
on the efficiency of each is more appropriate now.
Second method:
// ReSharper disable PossibleNullReferenceException
return (from entity in
Session.QueryOver<WorkingDay>().List()
group entity by entity.Date
into grouped
select
new DaySummaryDetail
{
Date = grouped.Key,
TotalMinutes = grouped.Sum(x =>
x.Duration.EndTime - x.Duration.StartTime)
}).ToList();
// ReSharper restore PossibleNullReferenceException
Thanks
--
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.