Пример #1
0
        public ActionResult <PersonViewDto> CreatePerson(PersonCreateDto personCreateDto)
        {
            var personModel = _mapper.Map <Person>(personCreateDto);

            _repository.CreatePerson(personModel);
            _repository.SaveChanges();

            var personView = _mapper.Map <PersonViewDto>(personModel);

            return(CreatedAtRoute(nameof(GetPersonById), new { personId = personView.Id }, personView));
            //return Ok(personView);
        }