public static Scenario GetScenario(SmartHomeDbContext context, int id) { var scenes = context.Scenarios.Where(s => s.Id == id).ToList(); if (scenes.Count == 0) { return(null); } return(scenes[0]); }
public static void AddScenario(SmartHomeDbContext context, Models.Scenario scenario) { context.Add(scenario); }
public static List <Models.Room> Select(SmartHomeDbContext context) { return(context.Rooms.Include(r => r.House).ToList()); }
public static void AddRoom(SmartHomeDbContext context, Models.Room roomData) { context.Add(roomData); }