コード例 #1
0
        public void EditProduct(int id, string name, string size, int price)
        {
            var db          = new DataEntities();
            var editProduct = db.Products.Find(id);

            editProduct.Name            = name;
            editProduct.Size            = size;
            editProduct.Price           = price;
            db.Entry(editProduct).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }