// GET: EF6 public ActionResult Index() { using (var db = new FabricsEntities()) { var data = db.Product.Where(p => p.ProductId > 1500).ToList(); return View(data); } // var db = new FabricsEntities(); // var data = db.Product.Where(p => p.ProductId > 1500); // return View(data); }
public int addProduct() { using (var db = new FabricsEntities()) { var product = new Product() { ProductName = "T-Shirt", Price = 199, Active = true, Stock = 10 }; db.Product.Add(product); db.SaveChanges(); return product.ProductId; } //return 0; }
public ActionResult UpdataProduct() { using (var db = new FabricsEntities()) { var data = db.Product.Find(1); } return View(); }