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