예제 #1
0
        public async Task <ActionResult> Create(CiudadanoCreateDto model)
        {
            var result = await _ciudadanoService.Create(model);

            return(CreatedAtAction(
                       "GetById",
                       new { id = result.CiudadanoId },
                       result
                       ));
        }
예제 #2
0
        public async Task <CiudadanoDto> Create(CiudadanoCreateDto model)
        {
            var entry = _mapper.Map <Ciudadano>(model);

            await _context.AddAsync(entry);

            await _context.SaveChangesAsync();

            return(_mapper.Map <CiudadanoDto>(entry));
        }