示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, kymiraAPIContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            context.Database.EnsureCreated();

            Fixtures.fixture_resident.delete(context);
            Fixtures.fixture_resident.load(context);

            Fixtures.fixture_bin_status.Unload(context);
            Fixtures.fixture_bin_status.Load(context);

            // Fixtures for Disposables List Table
            Fixtures.fixture_disposables.Unload(context);
            Fixtures.fixture_disposables.Load(context);

            //Fixture for FAQ Table
            Fixtures.fixture_faq.Unload(context);
            Fixtures.fixture_faq.Load(context);


            app.UseMvc();
        }
 public DisposablesController(kymiraAPIContext context)
 {
     _context = context;
 }
 public ResidentsController(kymiraAPIContext context)
 {
     _context = context;
 }
 /**
  * This function will create a connection to a local test database and load the specific data into it.
  * It first adds the Site objects needed and then loads in the following BinStatus objects.
  * */
 public static void Load(kymiraAPIContext _context)
 {
     _context.Site.AddRange(obSites);
     _context.BinStatus.AddRange(obBins);
     _context.SaveChanges();
 }
 /**
  * This function will delete all test information in the database.
  * */
 public static void Unload(kymiraAPIContext _context)
 {
     _context.Site.RemoveRange(_context.Site); //removes corresponding BinStatus's for each Site as well
     _context.SaveChanges();
 }
示例#6
0
 /**
  * This function will remove everything from FAQ table.
  * */
 public static void Unload(kymiraAPIContext _context)
 {
     _context.FAQDBSet.RemoveRange(_context.FAQDBSet);
     _context.SaveChanges();
 }
示例#7
0
 /**
  * This function will create a connection to a local test database and load the specific data into it (the FAQ objects).
  * */
 public static void Load(kymiraAPIContext _context)
 {
     _context.FAQDBSet.AddRange(listFAQ);
     _context.SaveChanges();
 }
 public CredentialsController(kymiraAPIContext context)
 {
     _context = context;
 }
示例#9
0
 public BinStatusController(kymiraAPIContext context)
 {
     _context = context;
 }
示例#10
0
 /**
  * This function will create a connection to a local test database and load the specific data into it.
  * */
 public static void Load(kymiraAPIContext _context)
 {
     _context.DisposableDBSet.AddRange(obList);
     _context.SaveChanges();
 }
示例#11
0
 /*
  * This function will be responsible for removing the test data from the Resident table.
  */
 public static void delete(kymiraAPIContext _context)
 {
     //Remove everything from the Resident table
     _context.ResidentDBSet.RemoveRange(_context.ResidentDBSet);
     _context.SaveChanges();
 }
示例#12
0
 /*
  * This function will be responsible for actually loading the test data into the Resident table.
  */
 public static void load(kymiraAPIContext _context)
 {
     //Add the list of residents to the database
     _context.ResidentDBSet.AddRange(residentList);
     _context.SaveChanges();
 }
示例#13
0
 public FAQsController(kymiraAPIContext context)
 {
     _context = context;
 }