Esempio n. 1
0
 public static List <Supply> GetSupply()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Supply.ToList());
     }
 }
Esempio n. 2
0
 public static List <Item> GetItem()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Item.ToList());
     }
 }
Esempio n. 3
0
 public static List <Food> GetFood()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Food.ToList());
     }
 }
Esempio n. 4
0
 public static List <Contact> GetContact()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Contact.ToList());
     }
 }
Esempio n. 5
0
 public static List <Category> GetCategory()
 {
     //this sets up the db connection
     using (var db = new SHTFListContext())
     {
         //ToList() is a built-in method, and this is putting everything in the Category table into a list
         return(db.Category.ToList());
     }
 }
Esempio n. 6
0
        public static int Create(string catName)
        {
            var db       = new SHTFListContext();
            var category = new Category {
                Name = catName
            };

            db.Category.Add(category);
            db.SaveChanges();
            return(1);
        }