public SectionAddOrUpdateResponseDto AddOrUpdate(SectionAddOrUpdateRequestDto request) { var entity = _repository.GetAll() .FirstOrDefault(x => x.Id == request.Id && x.IsDeleted == false); if (entity == null) { _repository.Add(entity = new Section()); } entity.Name = request.Name; _uow.SaveChanges(); return(new SectionAddOrUpdateResponseDto(entity)); }
public IHttpActionResult Update(SectionAddOrUpdateRequestDto dto) { return(Ok(_sectionService.AddOrUpdate(dto))); }