Entity Framework ObjectSet with its method ToList shows just saved entities. That means, when I call
context.AddToCustomers(myNewCust);
and then (without calling SaveChanges)
myDataGrid.DataContext = context.Customers.ToList();
the DataGrid doesn't show the newly added entity (even context.Customers.Count()
doesn't include it).
Is there any way to show these entities (those with EntityState = Added
) ?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…