Something else you might consider is using LinqBridge
http://www.albahari.com/nutshell/linqbridge.aspx

 

If you have VS 2008 you can use many of the features of C# 3.0, including
Linq to objects, and still compile to a 2.0 assembly.

 

From: [email protected] [mailto:[email protected]] On Behalf
Of Fabio Maulo
Sent: 02 April 2009 15:00
To: [email protected]
Subject: [nhusers] Re: Can i query in hql inside an IList instead of the
database ?

 

BTW you can use the clause 'in' with a sub-select or a collection of values
even in HQL.

2009/4/2 similitude2009 <[email protected]>


Thank you.


On 2 avr, 13:56, Germán Schuager <[email protected]> wrote:
> var bobs = new List<Person>(oList).FindAll(delegate(Person p) { return
> p.Name == "Bob"; });
>

> On Thu, Apr 2, 2009 at 6:17 AM, similitude2009
<[email protected]>wrote:

>
>
>
>
>
> > Is it possible to use the result of an hql query as source of another
> > hql query instead of hitting the database a second time ?
>
> > Eg :
> > ISession oSession = GetSession();
> > IQuery oQuery = oSession.CreateQuery("from Person select Person p");
> > IList<Person> oList = oQuery.List<Person>();
> > oSession.Close();
>
> > Now i want to query in memory list instead of database
> > ISession oSession = GetSession();
> > IQuery oQuery = oSession.CreateQuery("from {:pList} select Person p
> > where p.Name = 'bob' ");
> > oQuery.AddParameter("pList",oList );
> > IList<Person> oList = oQuery.List<Person>();

> > oSession.Close();- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -




-- 
Fabio Maulo



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