Пример #1
0
 public static List <Keyboard> GetKeyboards()
 {
     using (var model = new HardwareModel())
     {
         var keyboards = model.Keyboards.Include(k => k.Brand);
         return(keyboards.ToList());
     }
 }
Пример #2
0
        //// Collection of Keyboards
        //public static List<Keyboard> Keyboards { get; set; }

        #endregion

        #region Methods
        public static void AddKeyboard(Keyboard Keyboard)
        {
            using (var model = new HardwareModel())
            {
                model.Keyboards.Add(Keyboard);
                model.SaveChanges();
            }
        }