Beispiel #1
0
        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);
        }
Beispiel #2
0
 public VolunteersController(AnimalRescueContext context)
 {
     _context = context;
 }
Beispiel #3
0
 public EmployeesController(AnimalRescueContext context)
 {
     _context = context;
 }
 public AnimalsController(AnimalRescueContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public AnimalService(AnimalRescueContext context)
 {
     _context = context;
 }