I realize this must be a relatively simple thing to do, but I'm not getting what I'm looking for with Google.
I need to get the record ID of the record I just saved using the Entity Framework. With SQL queries we used "Select @@IDENTITY as 'Identity';"
If anyone can help it would be greatly appreciated.
The default behavior of Entity Framework is it sets identity fields on entities from the database right after
SaveChangesis called.In the following sample code, before
SaveChangesis called, my employee has a default ID of 0. AfterSaveChangesmy employee has a generated ID of 1.