SQL Server supports the auto-generation of primary key
values through the identity setting. When creating a new LINQ business object,
the value of the primary key is zero; meaning no value has been assigned. Calling
SubmitChanges on the DataContext refreshes this value with the auto-generated
value assigned from the backend database. Let us take a look at an example.
When creating a new business object, the value of the
primary key is illustrated below.
Product product = new Product();
product.Name = "Value";
//Assign remaining values.
But after the call to submit changes, the value is updated
The product key is assigned to an actual value after the
product is refreshed.