public async Task <SantinhoDto> Editar(int id, SantinhoDto dto) { var santinho = await _context.Santinho.FindAsync(id); santinho = _mapper.Map(dto, santinho); await _context.SaveChangesAsync(); return(_mapper.Map <SantinhoDto>(santinho)); }
public async Task <SantinhoDto> Cadastrar(SantinhoDto dto) { var santinho = _mapper.Map <Santinho>(dto); _context.Santinho.Add(santinho); await _context.SaveChangesAsync(); return(_mapper.Map <SantinhoDto>(santinho)); }