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