Example #1
0
 public static void RemoveCategory(Category category)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Categories.Remove(category);
         db.SaveChanges();
     }
 }
Example #2
0
 public static void RemoveBrand(Brand brand)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Brands.Remove(brand);
         db.SaveChanges();
     }
 }
Example #3
0
 public static void AddCategory(params Category[] category)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Categories.AddRange(category);
         db.SaveChanges();
     }
 }
Example #4
0
 public static void AddBrand(params Brand[] brand)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Brands.AddRange(brand);
         db.SaveChanges();
     }
 }
Example #5
0
 public static void AddBrand(Brand brand)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Brands.Add(brand);
         db.SaveChanges();
     }
 }
Example #6
0
 public static void RemoveUser(User user)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Users.Remove(user);
         db.SaveChanges();
     }
 }
Example #7
0
 public static void AddUser(params User[] user)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Users.AddRange(user);
         db.SaveChanges();
     }
 }
Example #8
0
 public static void AddUser(User user)
 {
     using (ModelOfShop db = new ModelOfShop())
     {
         db.Users.Add(user);
         db.SaveChanges();
     }
 }