/// <inheritdoc /> public async Task <ResponseValueDto> AddAsync(RequestCreateValueDto createValue) { Guard.Argument(() => createValue).NotNull(); var valueEntityMapp = _mapper.Map <RequestCreateValueDto, Entities.Value>(createValue); var valueEntity = await _valueRepository.AddAsync(valueEntityMapp); return(_mapper.Map <Entities.Value, ResponseValueDto>(valueEntity)); }
public async Task <IActionResult> Post([FromBody] ValueToAddModel vtam) { var valueToAdd = new Value { Name = vtam.Name }; await _valueRepository.AddAsync(valueToAdd); await _valueRepository.SaveAsync(); return(StatusCode(201)); }
/// <inheritdoc /> public async Task <ValueDto> AddAsync(CreateValueDto createValue) { Guard.Argument(() => createValue).NotNull(); var valueEntityMapp = _mapper.Map <CreateValueDto, Domen.Entities.Value>(createValue); var valueEntity = await _valueRepository.AddAsync(valueEntityMapp); var valueMapp = _mapper.Map <Domen.Entities.Value, ValueDto>(valueEntity); return(valueMapp); }