//Add
        public async Task <Pet> AddAsync(PetDto pet)
        {
            Pet newPet = new Pet()
            {
                Id          = Guid.NewGuid(),
                Name        = pet.Name,
                Description = pet.Description,
                Type        = pet.Type
            };

            using var connection = _connectionFactory.Connection();
            connection.Open();
            await connection.InsertAsync(newPet);

            return(newPet);
        }
Esempio n. 2
0
 //Add
 public async Task AddAsync(Pet pet)
 {
     using var connection = _connectionFactory.Connection();
     connection.Open();
     await connection.InsertAsync(pet);
 }