public async Task <IActionResult> Put(ValueDto value) { var dbValue = value?.Adapt <Value>(); _unitOfWork.GetRepository <Value>().Update(dbValue); await _unitOfWork.SaveChangesAsync(); return(Ok(dbValue.Adapt <ValueDto>())); }
public async Task <IActionResult> Post(ValueDto value) { value.Id = 0; var dbValue = value?.Adapt <Value>(); await _unitOfWork.GetRepository <Value>().InsertAsync(dbValue); await _unitOfWork.SaveChangesAsync(); return(CreatedAtAction(nameof(Get), new { id = dbValue.Id }, dbValue?.Adapt <ValueDto>())); }