I am using the WCF Ria Services (DomainServices) with the Entity Framework to model my entities and present them through an MVVM with an ObservableCollection.
When the user add's a new record into the grid, I call Context.Add(entity) and Context.SubmitChanges() methods during the ObserableCollection.CollectionChanged event.
At the point of submitting changes I get the following error:
Entity 'Foo : 0' is currently being edited and has uncommitted changes. A call to BeginEdit must be followed by a call to EndEdit or CancelEdit before changes can be submitted.
Any idea why when the user tabs off the record and this collection event fires, it would throw this exception?
Thanks
Oh nevermind, I guess casting the entity to IEditableObject and calling EndEdit would work too! :)