1st point
This is very appealing
Both solutions seems to imply that you code in Visual Studio 2008 and
target machines with only .NET 2.0 SP1 installed.
http://weblogs.asp.net/fmarguerie/archive/2007/09/05/linq-support-on-net-2-0.aspx
http://www.albahari.com/nutshell/linqbridge.aspx

Has anyone ever got them working with Visual Studio 2005 ?


2nd point
About in clause in HQL, what is the best way to pass large collections
of Id ?
I m currently using HQL to convert my Persons in PersonsDTO using

IList<int> oListId = Manager.GetInterestingPersonId();
oSession.Query("select new PersonDTO(p.Id,p.Name) from Person p where
p.Id in {:pListId}");
oSession.AddParameter("pListId",oListId);
IList<PersonDTO> = oSession.List<PersonDTO>;

but this fails as soon as the number of Id's in IList get over 2000,
because of the size of the SQL query generated.

On 3 avr, 12:51, "Robert Byrne" <[email protected]> wrote:
> Something else you might consider is using 
> LinqBridgehttp://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- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -
--~--~---------~--~----~------------~-------~--~----~
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