예제 #1
0
        /// <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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        /// <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);
        }