Database bulk operations
Basic examples
// Bulk delete all LocaleStringResource entities
// whose ResourceName property start with "MyModule."
await db.LocaleStringResources
.Where(x => x.ResourceName.StartsWith("MyModule."))
.ExecuteDeleteAsync();
// Append " (old)" to the Name property of product entities
// whose year of creation is before 2020.
await _db.Products
.Where(x => x.CreatedOnUtc.Year < 2020)
.ExecuteUpdateAsync(
x => x.SetProperty(p => p.Name, p => p.Name + " (old)"));Last updated
Was this helpful?