Or Dynamic LINQ?

http://dynamiclinq.codeplex.com/


On Monday, October 6, 2014 5:39:09 PM UTC+1, Gunnar Liljas wrote:
>
> Ah...I suggest you build the Linq query dynamically instead.
>
> /G
>
> 2014-10-06 17:21 GMT+02:00 Daniel Thaller <[email protected] 
> <javascript:>>:
>
>> its built by the user (some sort of query-editor which results in a 
>> querystring)
>>
>> On Monday, October 6, 2014 5:14:08 PM UTC+2, Gunnar Liljas wrote:
>>>
>>> AFAIK, there is currently no way to do this. What is it about the first 
>>> query that makes this necessary?
>>>
>>> 2014-10-06 17:09 GMT+02:00 Fran Knebels <[email protected]>:
>>>
>>>> http://ayende.com/blog/3993/nhibernate-filters
>>>> On Oct 6, 2014 11:05 AM, "Daniel Thaller" <[email protected]> wrote:
>>>>
>>>>> can you give an example of what you mean, please?
>>>>>
>>>>> On Monday, October 6, 2014 2:17:29 PM UTC+2, fknebels wrote:
>>>>>>
>>>>>> 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.
>>>>>
>>>>  -- 
>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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