Could you use filters?
On Oct 6, 2014 8:04 AM, "Daniel Thaller" <[email protected]> wrote:

> I am creating queries from raw sql like this: ()
>
> var query = "SELECT * from ORDERS o where o.Year in (:orderYear));";
>
> var session = sessionFactory.OpenSession();
> var result =session.CreateSQLQuery(query)
>                 .AddEntity(typeof(Order))
>                 .SetInt32("orderYear",2012)
>                 .List<Order>();
>
> The query shown above should be restricted further dynamically by the user.
> What i normally do is get an IQueryable and add my where-clauses.
> But how can i combine the query shown above with IQueryable WITHOUT getting 
> the list of elements from the above query first?
>
> what i want (pseudocode):  CurrentSession.Query<Order>().Where(x => 
> query.Contains(x)).ToList()
> => so i want to execute both queries in the same statement, because if the 
> first query yields many results i get in real performance-troubles if i have 
> to retrieve the list of the first query beforehand.
>
> Is there a way to archive my goal?
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to