Ah, interesting! I'm using the 3.0.0 beta 2 and was under the
impression that QueryOver is the new Linq implementation.
When I use "where statuses.Contains(s.Id)" I get the exception below,
which is weird:
Test
'Lumo.Complaints.DL.Tests.ComplaintRepositoryTests.GetPotentialBreachesForUsersTest_Linq'
failed: System.Exception : Unrecognised method call:
System.Collections.Generic.ICollection`1[[System.String, mscorlib,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]]:Boolean Contains(System.String)
at
NHibernate.Impl.ExpressionProcessor.ProcessCustomMethodCall(MethodCallExpression
methodCallExpression)
at
NHibernate.Impl.ExpressionProcessor.ProcessBooleanExpression(Expression
expression)
at NHibernate.Impl.ExpressionProcessor.ProcessExpression(Expression
expression)
at
NHibernate.Impl.ExpressionProcessor.ProcessLambdaExpression(LambdaExpression
expression)
at NHibernate.Impl.ExpressionProcessor.ProcessExpression[T]
(Expression`1 expression)
at NHibernate.Criterion.QueryOver`2.Add(Expression`1 expression)
at NHibernate.Criterion.QueryOver`2.Where(Expression`1 expression)
at
NHibernate.Criterion.QueryOver`2.NHibernate.IQueryOver<TRoot,TSubType>.Where(Expression`1
expression)
Domain\Repositories\ComplaintRepository.cs(68,0): at
Lumo.Complaints.DL.Domain.Repositories.ComplaintRepository.GetPotentialBreachesForUsers_Linq(IList`1
usernames)
ComplaintRepositoryTests.cs(27,0): at
Lumo.Complaints.DL.Tests.ComplaintRepositoryTests.GetPotentialBreachesForUsersTest_Linq()
Should I try with the Contrib Linq library, instead? I apologize for
noob questions. :)
On Nov 17, 7:32 am, Diego Mijelshon <[email protected]> wrote:
> BTW, QueryOver is not LINQ.
>
> Diego
>
> On Mon, Nov 15, 2010 at 23:24, José F. Romaniello
> <[email protected]>wrote:
>
>
>
>
>
>
>
> > "where statuses.Contains(s.Id)" thats the way.
>
> > 2010/11/15 MisterY <[email protected]>
>
> > Hi all,
>
> >> Is it possible to have a "where ... in ..." query using Linq to
> >> NHibernate? Something along the line of
>
> >> var query = from s in Session.QueryOver<Status>()
> >> where s.Id in statuses
> >> select s;
>
> >> Or "where statuses.contains(s.Id)". Maybe there is a workaround of
> >> sorts?
>
> >> Cheers,
>
> >> Alen
>
> >> --
> >> 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]<nhusers%[email protected]
> >> >
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/nhusers?hl=en.
>
> > --
> > 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]<nhusers%[email protected]
> > >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.
--
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.