Esempio n. 1
0
        public void DeleteProductBrands(ProductBrand ct)
        {
            UniversalContext db = new UniversalContext();

            using (db)
            {
                db.Entry(ct).State = EntityState.Deleted;
                db.ProductBrands.Remove(ct);
                db.SaveChanges();
            }
        }
Esempio n. 2
0
        public void AddProductBrand(ProductBrand productBrand)
        {
            UniversalContext db = new UniversalContext();

            using (db)
            {
                db.Entry(productBrand.ProductType).State = EntityState.Unchanged;
                db.ProductBrands.Add(productBrand);
                db.SaveChanges();
            }
        }