Felipe,

I'd do something like .Where(p => idCategories.Contains(p.IdCategory)), but 
I find it is sometimes finicky about the type.  I use List<int> without a 
problem.

    Don

On Monday, July 16, 2012 10:50:09 PM UTC-4, Felipe Oriani wrote:
>
> Hello Guys, I have a linq query with NHibernate using Session.Query<T> 
> method and I in this query I Fetch some complex properties and collection 
> properties. I would like to know, how cna I add an condition with IN 
> operator from an int[] ? Look my code:
>
> public IEnumerable<Product> GetProducts(int[] idCategories) 
> {
>     // how to add IN condition here or a subquery 
>     var query = 
> Session.Query<Product>().Where(?????).Fetch(x=>xCategory).FetchMany(x=>x.Status).ThenFetch(x=>x.Item);
>
>     return query.ToList();
> }
>
> I have another method doing a query to get this int[] and I would like to 
> apply it here, or if is there any way to add this subquery on the IN 
> operator, I really appreciate! 
>
> Thank you!
>
> -- 
> ______________________________________
> Felipe B. Oriani
>
>
> "...Trabalhe quanto puder, tornando-se útil quanto possível..." , por 
> André Luiz
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/Hqr2JRy-dmYJ.
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