/// <summary> /// Delete an entity. /// </summary> /// <param name="model"></param> public void Delete(CaseViewModel model) { var entity = model.ToEntity(); this._CasesRepository.Delete(entity); #region Commit Changes this._unitOfWork.Commit(); #endregion }
/// <summary> /// Update an entity. /// </summary> /// <param name="model"></param> /// <returns></returns> public CaseViewModel Update(CaseViewModel model) { this.ThrowExceptionIfExist(model); var entity = model.ToEntity(); entity = this._CasesRepository.Update(entity); #region Commit Changes this._unitOfWork.Commit(); #endregion model = entity.ToModel(); return(model); }