コード例 #1
0
        public async Task Update([FromBody] PlanAreaServiceModel model)
        {
            PlanArea planArea = await _planAreaService.GetByIdAsync(model.Id);

            ValidateUser(planArea.Plan.UserId);

            await _planAreaService.UpdateAsync(model);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
            }
        }