private static AnimalRescueContext CreateTestContext(params Animal[] animals) { var options = new DbContextOptionsBuilder <AnimalRescueContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; var context = new AnimalRescueContext(options); context.Database.EnsureCreated(); foreach (var animal in animals) { context.Add(animal); } context.SaveChanges(); return(context); }
public VolunteersController(AnimalRescueContext context) { _context = context; }
public EmployeesController(AnimalRescueContext context) { _context = context; }
public AnimalsController(AnimalRescueContext context) { _context = context; }
public AnimalService(AnimalRescueContext context) { _context = context; }