I have been trying to experiment with the new UpdateAll extension method and it is just throwing an error while trying to run the update. I have a generic class that allows operations on the different classes generated by the OpenAccess designer and added a generic UpdateAll function that takes an expression to filter on and then the updateDescription that the UpdateAll method is looking for.
>> rowSelector, Expression<Func<ExtensionMethods.UpdateDescription<T>, ExtensionMethods.UpdateDescription<T>>> updateDescription)
(var _entities =
The rowSelector that I am passing in is filtering down to a single element on the primary key and the updateDescription is chained to update 3 different fields:
ContactLogRepository.UpdateAll(x => x.Id == id,
x => x.Set(y => y.StatusId, y => 2)
.Set(y => y.ModifiedBy, y => "Some Name")
.Set(y => y.ModifiedOn, y => DateTime.Now));
Using the profiler, the SQL that is generated appears like it should work:
a.[Id] = 1178435
x.[StatusId] = 2,
'6/27/2013 4:53:17 PM'
(x.[Id] = t.C0)
However, it throws an error while executing:
"Failure: Batch Update failed on server: Expected=1/Got=2"