public IActionResult UpdateHumiity(int Humidity) { PlantContext p = new PlantContext("server=studmysql01.fhict.local;user id=dbi414674;password=Dse56VGQx3;database=dbi414674;"); // p.UpdateTemp(1, Humidity); return(RedirectToAction("Index")); }
public IActionResult UpdateTemp(int Temperatuur) { PlantContext p = new PlantContext("server=studmysql01.fhict.local;user id=dbi414674;password=Dse56VGQx3;database=dbi414674;"); //p.UpdateTemp(1,Temperatuur); ViewData["Temp"] = p.GetCurrentValues(1); return(RedirectToAction("Index")); }
public void CanInsertPlantIntoDatabase() { using (var context = new PlantContext("Data Source = (localdb)\\MSSQLLocalDB; Initial Catalog = PlantTestData", false)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); var plant = new Plant(); context.Plants.Add(plant); context.SaveChanges(); Assert.AreNotEqual(0, plant.Id); } }
public TemperatureController(PlantContext ctx) { _ctx = ctx; }
public AlarmtypeController(PlantContext ctx) { _ctx = ctx; }
public Plants1Controller(PlantContext context) { _context = context; }
public HomeController(PlantContext context) { _context = context; }
public HomeController(PlantContext context, INativeService nativeService) { _context = context; _nativeServie = nativeService; }
public WatersController(PlantContext context) { _context = context; }
public static void Initialize(IServiceProvider serviceProvider) { using (var context = new PlantContext( serviceProvider.GetRequiredService < DbContextOptions <PlantContext> >())) { // Looking for any plants. if (context.Plants.Any()) { return; // DB has been seeded } // default data to seed the database with context.Plants.AddRange( new Plant { Name = "Dragon Tree", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 6, } } }, new Plant { Name = "Raye Banana", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 4, } } }, new Plant { Name = "Cacti #1", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 3, } } }, new Plant { Name = "Cacti #2", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 5, } } }, new Plant { Name = "Pothos", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 10, } } }, new Plant { Name = "Jade", Water = new List <Water> { new Water() { Date = DateTime.Now, Duration = 10, } } } ); context.SaveChanges(); } }
public NativeService(PlantContext context) { _context = context; }
public ConfigController(PlantContext ctx) { _ctx = ctx; }
public InvasiveService(PlantContext context) { _context = context; }