I have 4 tables: organization, donor, event, gift with a
relationships: donor has an organization, event has an organization,
gift has an event and donor.
I want to select all donors that have donated gifts to a specific
event ordered by their total donations.
Currently I can select all the active donors for an event:
var active_donors =
DetachedCriteria.For<Az.Item>()
.Add(Restrictions.Eq("Event", current_event))
.SetProjection(Projections.GroupProperty("Donor"));
IList<Donor> donors =
Session.CreateCriteria(typeof(Az.Donor))
.Add(Restrictions.Eq("Organization",
current_organization))
.Add(Subqueries.PropertyIn("Id", active_donors))
.List<Az.Donor>();
But I can't work out how to include the the total donations for the
donor, or how to order by it.
Any suggestions?
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.