Beispiel #1
0
        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]);
        }
Beispiel #2
0
 public static void AddScenario(SmartHomeDbContext context, Models.Scenario scenario)
 {
     context.Add(scenario);
 }
Beispiel #3
0
 public static List <Models.Room> Select(SmartHomeDbContext context)
 {
     return(context.Rooms.Include(r => r.House).ToList());
 }
Beispiel #4
0
 public static void AddRoom(SmartHomeDbContext context, Models.Room roomData)
 {
     context.Add(roomData);
 }