how to extend entity framework ,To achieve this effect
db.Users.Delete(o=>o.sex=="girl") db.Users.Update(o=>o.sex="girl")
Can batch modification and deletion, insert data
how to extend entity framework ,To achieve this effect
db.Users.Delete(o=>o.sex=="girl") db.Users.Update(o=>o.sex="girl")
Can batch modification and deletion, insert data
In Entity Framework 4 that's part of .NET 4.0 there is a method on the ObjectContext
ExecuteStoredCommand(string cmdText, object[] parameters)
This allows to execute set based operations directly against your datastore.
In your example you could do something like:
db.ExecuteStoreCommand("DELETE FROM [User] WHERE Sex = '{0}'", new[] {"girl"});