Search code examples
linqnhibernatebulk

Linq to Nhibernate Bulk Update Query Equivalent?


Not sure if I'm missing anything here. Basically, I am looking for Linq to Nhibernate to do the following SQL statement:

update SomeTable
set SomeInteger = (SomeInteger + 1)
where SomeInteger > @NotSoMagicNumber

Is there any way to do that?

Thanks!


Solution

  • Linq (not Linq to NHibernate, Linq in general) does not have a bulk update verb like SQL has. If you need the efficiency of the bulk update statement like yours, I'd just stick to SQL.