We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I know EF is good for doing things object model ways, but sometimes bulk operations are very time consuming. I propose following features.
Select Insert Lets say I want to send message to all customers with certain filter.
db.Messages.InsertAsync( db.Customers.Where( c=> c.State == State.Active && // note the navigation property c.Orders.Any( o=> o.State == State.Completed && o.OrderDate > startDate) ) // select some fields... .Select( c=> new Message{ RecipientName = c.Name, Subject = "Your order summary ", Message = $"Thank you so much for your {c.Order s.Count( o => o.State==State.Completed && o.OrderDate > startDate)} order(s)." } ) );
The above query does not return any objects, it simply generates a big INSERT SELECT and executes on the server.
Update/Delete - with Lambda
db.Customers.DeleteAsync( c=> c.State == State.Inactive && !c.Orders.Any()); db.Customers.UpdateAsync( c=> c.State == State.Inactive && c.Orders.Any() ) .Set( c => new { LastCheck = DateTime.UtcNow } );
The text was updated successfully, but these errors were encountered:
Probably an exact duplicate of #795.
Sorry, something went wrong.
No branches or pull requests
I know EF is good for doing things object model ways, but sometimes bulk operations are very time consuming. I propose following features.
Select Insert
Lets say I want to send message to all customers with certain filter.
The above query does not return any objects, it simply generates a big INSERT SELECT and executes on the server.
Update/Delete - with Lambda
The text was updated successfully, but these errors were encountered: