Is there a way to update a single table / entity without having to read the entity first into a list. This is the sql I am trying to achieve.
Update table set col1 = Case col2 When 0 then 1 else 0 end this updates roughly 500,000 records under a second
I do not want to do
List<table> updRecs = Context.tables.toList();
for each
{
if(col1 == 0)
col2 = true
else
col2 = false
}
Context.SaveChanges();
above is very slow roughly 4 minutes.
EntityFramework.Extended
context.Tasks
.Where(t => t.StatusId == 1)
.Update(t => new Task { StatusId = 2 });