MikaelEliasson / EntityFramework.Utilities

Provides extensions for EntityFramework that doesn't exist out of the box like delete and update by query and bulk inserts
443 stars 176 forks source link

Update by query several properties #109

Open milleraa opened 7 years ago

milleraa commented 7 years ago

Hi!

How to update by query more than one property? Are there any examples?

RudeySH commented 6 years ago

Yes, that's possible!

EFBatchOperation.For(db, db.Users)
    .UpdateAll(users, x => x.ColumnsToUpdate(u => u.Foo, u => u.Bar));

You can provide as many u => u.PropertyName as you like.