I was wondering if it is a good practice to remove entity from the DataContext.GetChanges.Insert Collection?
Here I explain a bit more.
For some reason, I’m at a point where a row/entity have been inserted in a table and the SubmitChanges have not yet been called, so the Row is in pending insertion state and can be found in the DataContext.GetChanges(). But for some business logic reason I want to prevent that row from been inserted into the Database.
so a though about remove using something like :
DataContact.GetChages().Inserted.Remove(myRow);
Is this good?
Thanks
This will not do anything. The ChangeSet that you are operating on is just a snapshot that has no connection back to the DataContext. You can do with it whatever you want, it won’t cause the DataContext to behave differently.