Not Query Over, just plain LINQ, will this do?

IList<TicketRequest> results = UnitOfWork.CurrentSession.Query<Show>().Where(x 
=> x.ShowDate >= DateTime.Now).SelectMany(x => x.TicketRequests).ToList()

(not sure about the actual names)

RP


On Friday, July 5, 2013 10:31:58 PM UTC+1, karen L wrote:
>
> I wrote a joint query using NHiberNate, but I am getting a 
> NHibernate.QueryException
>
> This is what it looks like with NHibernate library
>
>         TicketRequest ticketAlias = null;
>         Show showAlias = null;
>
>         IList<TicketRequest> results = UnitOfWork.CurrentSession.QueryOver
> <TicketRequest>(() => ticketAlias)
>                   .JoinAlias(() => ticketAlias.ShowId, () => showAlias.Id)
>                   .Where(() => showAlias.ShowDate >=DateTime.Now)
>                   .List();
>
>         return results;
> nter code here...
>
> I just want a simple joint statement, and this is what it would have been 
> in SQL
>
> select * from TicketRequest as a join Show as b
> on a.Show_id = b.Id
> where ShowDate >=GETDATE()
>
> Can someone help and let me know why I am getting a "not an 
> association:Id" error. I have id in the "Show" table, it is a primary key.
>
>
> Many thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to