During a save using a scaffolded MVC Controller I want to get the properties changed.
private myEntities db = new myEntities();
public ActionResult Edit()
if (ModelState.IsValid)
{
tblQuote quote = db.Quotes
.Include(a => a.Parts)
.SingleOrDefault(x => x.QuoteID == 4);
quote.Name = "NewName"
db.Entry(quote).State = EntityState.Modified;
db.SaveChanges();
}
I've attempted to use GetModifiedProperties from here Getting all changes made to an object in the Entity Framework
var myObjectState=db.ObjectStateManager.GetObjectStateEntry(quote);
But VS tells me db "Does not contain a definition for ObjectStateManager". How do I get the changed fields from "quote"