Closed adamfoneil closed 3 years ago
This will really impact SaveAsync
because Merge
calls Save
internally.
this might be a little better if the model
arg were part of the delegate. This is so you can save
(or merge
) a new model instance inline within the method call, and still leverage the new delegates. Here's what the new delegate looks like in use:
var annotation = new Annotation()
{
DocumentId = documentId,
Content = xfdf
};
await cn.MergeAsync(annotation, onSave: (action) => TrackedRecord.Update(action, annotation, User.Identity.Name));
I'd prefer I could write it like this:
await cn.MergeAsync(new Annotation()
{
DocumentId = documentId,
Content = xfdf
}, onSave: (action, model) => TrackedRecord.Update(action, model, User.Identity.Name));
That way you could have dedicated insert and update behavior in cases when I can't use my convention base classes that use
IAudit