Closed pastaav closed 4 years ago
IsIn
works only with QueryOver
. Don't expect that something that works in QueryOver
will work with Query
- it's completely different API.
In Query
(LINQ) you need to use Contains
:
.Where(f => chunkOfIds.Contains(f.Id))
I am trying to use the new bulk updating feature of NHiberate 5 but runs inte an problem with the visitor that handle IsIn operation. We are using the IsIn operation for the same domainobject in other parts of the application with QuerOver so I am reasonably confident the mapping is right but when trying to apply the same pattern for Query it does not work.
Case that works
session.QueryOver<MyObject>().Where(x => x.Id.IsIn(chunkOfIds)).List<T>().ToList()
Case that does not work
session.Query<MyObject>().Where(f => f.Id.IsIn(chunkOfIds)) .Update(x => new MyObject{ SomeValue = 0});