コード例 #1
0
        public async Task <ActionResult <ServiceDto> > PostAsync([FromBody] ServiceCreateDto serviceCreateDTO)
        {
            var service         = _mapper.Map <Service>(serviceCreateDTO);
            var insertedService = await _serviceService.AddAsync(service);

            var insertedServiceDTO = _mapper.Map <ServiceDto>(insertedService);

            return(CreatedAtAction(nameof(GetAsync), new Response <ServiceDto>(insertedServiceDTO)));
        }