c# - EntityFramework show entities before saving changes -


The Entity Framework ObjectSet is known by its own method only by the saved organizations, this means when I call < / P>

  context.AddToCustomers (myNewCust);   

and then (without calling SaveChanges) DataDateGrid.DataContext = context.Customers.ToList ();

The DataGrade does not show the newly added entity (even the context.Customers.Count () is not included).

Thanks in advance

I think you have something Unsaved unsaved entities can be found by calling:

  var inserted = context.ObjectStateManager .GetObjectStateEntries (EntityState.Added) Where (E => EISR relationships). Select (E = & gt; ENTT). Off type & lieutenant; Cutom & gt; ();   

But by just reading your question, I know that you are trying to do something wrong. Why do you need to combine unsaved organizations? If you need to show disorganized material then you should put it in a separate collection of your own.

Comments