is there a way to insert an entity without using the SubmitChanges() function of the datacontext? I want to do this because I have other chan开发者_JAVA技巧ges done on my datacontext which I do not want to submit yet, if I call the SubmitChanges function it will submit all changes including the ones I do not want to save yet.
Either use the new DataContext instance as it is a light-weight OR Use the InsertOnSubmit method for those entities you want to add. Than calling the SubmitChanges only update desired entities.
精彩评论