Beispiel #1
0
 public static List <Supply> GetSupply()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Supply.ToList());
     }
 }
Beispiel #2
0
 public static List <Item> GetItem()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Item.ToList());
     }
 }
Beispiel #3
0
 public static List <Food> GetFood()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Food.ToList());
     }
 }
Beispiel #4
0
 public static List <Contact> GetContact()
 {
     using (var db = new SHTFListContext())
     {
         return(db.Contact.ToList());
     }
 }
Beispiel #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());
     }
 }
Beispiel #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);
        }