0 Replies - 1193 Views - Last Post: 10 September 2013 - 07:10 AM Rate Topic: -----

#1 tieugiang94  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 160
  • Joined: 07-December 11

How to exclude columns being updated by Entity Framework

Posted 10 September 2013 - 07:10 AM

My code here, I want only product.name being updated. How do I do this ?

public ActionResult EditProduct(Product product)
        {
            
            if (ModelState.IsValid)
            {
                db.Entry(product).State = EntityState.Modified;
               
                db.SaveChanges();
            }

            return View();
        }


Is This A Good Question/Topic? 0
  • +

Page 1 of 1