On Aug 21, 1:33 pm, Fabio Maulo <[email protected]> wrote:
> I don't know the domain butselect i.Event from Invitation i where i.Person =
> :pPerson

That's the problem; I don't know how to phrase a query to return a
specific field rather than the entire object.

For example, here's my query:

ICriteria criteria = Session.CreateCriteria<Invitation>()
        .Add(SqlExpression.CriterionFor<Invitation>(i => i.Person ==
person));
IList<Invitation> invitations = criteria.List<Invitation>();

This gives me back a list of Invitations.

I could now do something like:

IList<Event> events = new List<Event>();
foreach (Invitation i in invitations) events.Add(i.Event);

but that seems like something I should be able to do in the query
itself, without needing a separate loop. Is this possible?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to