Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] SaveConsultantResource resource)
        {
            var consultant = _mapper.Map <SaveConsultantResource, Consultant>(resource);
            var result     = await _consultantService.InsertAsync(consultant);

            var consultantResource = _mapper.Map <Consultant, ConsultantResource>(result.Resource);

            if (!result.Success)
            {
                return(BadRequest());
            }

            return(Ok(consultantResource));
        }