public void Delete(User user, OperationInfo opInfo) { using (DataModelProvider <UserDataModel> dataModelProvider = this.DataModelProviderFactory.CreateDataProvider <UserDataModel>()) { UserDataModel model = dataModelProvider.SelectById(user.Id); dataModelProvider.Update(model); this.UserEvents.OnDeleted(user, opInfo); } }
public void Change(UserChangeInfo changeInfo) { this.UserEvents.OnChanging(changeInfo); using (DataModelProvider <UserDataModel> dataModelProvider = this.DataModelProviderFactory.CreateDataProvider <UserDataModel>()) { UserDataModel model = dataModelProvider.SelectById(changeInfo.ChangeUser.Id); this.MapperFactory.Map <UserDataModel, UserChangeInfo>(model, changeInfo); dataModelProvider.Update(model); this.UserEvents.OnChanged(changeInfo); } }