Is it possible to get Nhibernate linq to generate a query with an "In" clause? e.g. - Where AnID in (x,y,z)
?
相关问题
- Check if tie in count of lists using linq
- Trouble with OR in Sharepoint CAML
- get key value pairs from xml using linq
- query and create objects with a one to many relati
- select column from dataset using LINQ
相关文章
- 想问问Linq中有没有根据条件选择要不要关联表。
- Fluent NHibernate — Saving Entity with Composite K
- Why do I need a ToList() to avoid disposed context
- LINQ .Include() properties from sub-types in TPH i
- Can a method chain be called LINQ?
- Is this the right way of using ThenFetch() to load
- Can Persistence Ignorance Scale?
- Get grouped comma separated values with linq
Agreed, this does work. I found the generated SQL for 'not in' to be strange though (as of 3.3.0 GA)
Seems a bit odd to 'case' this when 'not in' would have been clearer (not that I plan on reading every line, but in a trace/profile maybe).
(... later that day ...)
I realized that the above 'strange' choice of SQL was only when I used
If I used
The SQL generated is much cleaner (using 'not in')
I don't know the state of nHibernate with respect to generating all the potential LINQ queries, but you should be able to use
.Contains()
to generate an IN.NHibernate has an option IsIn part of RestrictionExtensions