public void AfterInsert(object model, DataOperationArgs args) { var action = GetDataOperationActions().FirstOrDefault(a => a.OperationEvent == DataOperationEvents.AfterInsert); if (action != null) { action.Method(model, args); } }
public object InsertItem(IDynamicEditForm form, object item) { var db = GetDbContext(form); db.Insert(item); // after save action var args = new DataOperationArgs { DataContext = db, OperationEvent = DataOperationEvents.AfterInsert, Parameters = _serviceParameters }; form.AfterInsert(item, args); return(item); }