public async Task Update([FromBody] PlanAreaServiceModel model) { PlanArea planArea = await _planAreaService.GetByIdAsync(model.Id); ValidateUser(planArea.Plan.UserId); await _planAreaService.UpdateAsync(model); }
public async Task UpdateAsync(PlanAreaServiceModel model) { PlanArea planArea = await _planAreaObjectService.GetByIdAsync <PlanArea>(model.Id); if (planArea == null) { throw new DomainServicesException("Plan Area not found."); } planArea.Name = model.Name; await _planAreaObjectService.UpdateAsync(planArea); }
public async Task UpdateAsync(PlanAreaServiceModel model) { using (_unitOfWork) { PlanArea planArea = await _planAreaReadRepository.GetByIdAsync(model.Id); if (planArea == null) { throw new DomainServicesException("Plan Area not found."); } planArea.Name = model.Name; await _unitOfWork.CommitAsync(); } }