Ejemplo n.º 1
0
        public async Task <Species> CreateAsync(Species entity)
        {
            using (GestionAnimalDbContext context = _contextFactory.CreateDbContext())
            {
                Species createdEntity = context.Species.Add(entity);
                await context.SaveChangesAsync();

                return(createdEntity);
            }
        }
Ejemplo n.º 2
0
        public async Task <Animal> CreateAsync(Animal entity)
        {
            using (GestionAnimalDbContext context = _contextFactory.CreateDbContext())
            {
                Animal createdEntity = context.Animals.Add(entity);
                await context.SaveChangesAsync();

                return(createdEntity);
            }
        }