private static void InitialiseRepositories() { var sqlConnection = ConfigurationManager.ConnectionStrings["PetAdoptionContextConnection"].ConnectionString; var builder = new DbContextOptionsBuilder <PetAdoptionContext>(); builder.UseSqlServer(sqlConnection); var petAdoptionContext = new PetAdoptionContext(builder.Options); //DbInitialiser.Initialize(petAdoptionContext); _dogRepository = new DogRepository(petAdoptionContext); // new Context.PetAdoptionContext(null, null)); _catRepository = new CatRepository(petAdoptionContext); // new Context.PetAdoptionContext(null, null)); }
public PetServiceDb(PetAdoptionContext context) { _context = context; }
public DogRepository(PetAdoptionContext context) { _context = context; }