// Fridge public RedirectResult ToogleColdstoreDoor(int id = 0) { if (id != 0) { Device device = db.GetDeviceById(id); if (device != null && device is Fridge) { Fridge fridge = (Fridge)device; if (fridge.ColdstoreIsOpen) { fridge.CloseColdstore(); } else { fridge.OpenColdstore(); } db.UpdateDeviceById(id, device); } } return(Redirect("/Home/Index")); }