views:

220

answers:

0

I have the problem that when calling SubmitChanges() objects that have not been attached to a collection or added using InsertOnSubmit(), are still being inserted into the database.

I read online that when assigning an object to a property that represents a foreign key, this object is automatically added to the collection of objects to be added to the database when SubmitChanges() is called.

What's the best way to overcome this?

EDIT: After attempting to explain my problem, it became rather convoluted, so I gave up. On the plus side I did manage to overcome my problem, by using a separate DataContext.