/// <summary> /// Updates an existing item in the database. /// </summary> /// <param name="entity"> /// The entity. /// </param> protected override void PersistUpdatedItem(INotificationMethod entity) { ((Entity)entity).UpdatingEntity(); var factory = new NotificationMethodFactory(); var dto = factory.BuildDto(entity); Database.Update(dto); entity.ResetDirtyProperties(); }
/// <summary> /// Adds a new item to the database. /// </summary> /// <param name="entity"> /// The entity. /// </param> protected override void PersistNewItem(INotificationMethod entity) { ((Entity)entity).AddingEntity(); var factory = new NotificationMethodFactory(); var dto = factory.BuildDto(entity); Database.Insert(dto); entity.Key = dto.Key; entity.ResetDirtyProperties(); }