Hi,
From what I gather, Linq to SQL doesn't actually execute any database commands (including the opening of database connections) until the SubmitChanges()
method is called. If this is the case, I would like to increase the efficiency of a few methods. Is it possible for me to retrieve the ID
of an object before inserting it? I'd rather not call SubmitChanges()
twice, if it's possible for me to know the value of the ID before it's actually inserted into the database. From a logical point of view, it would only makes sense to have to open a connection to the database in order to find out the value, but does an insertion procedure also have to take place?
Thanks