return an int of updated records in the Update method
On the Update method of BaseProxyClass, return an int of updated records. If no Update was sent because _changedValues.Count was 0, it should return 0, otherwise 1. This would help to count the amount of updates that were sent for logging purposes.
public int Update(IOrganizationService service)
{
if (_changedValues.Count > 0)
{
service.Update(GetChangedEntity());
_changedValues.Clear();
return 1;
}
return 0;
}
3
votes
Ahash Sritharan
shared this idea
-
Wiktor commented
Hi Ahash,
you could bypass this by using the IsDirty property. As you see, the Update only happens if there are changed values. So your code could look like this:
var entitiesThatWillGetUpdatedCount = myEntities.Count(x => x.IsDirty);