Reputation: 10216
I am added a record in my table e.g. Orders
. After adding the record i want to get the newly generated ID of the inserted record. Like SCOPEIDENTY
in SQL.
But how can i do this in Entity Framework.
Upvotes: 5
Views: 1311
Reputation: 10074
After you saved your changes, your entity object should reflect the newly generated ID automagically. It's one of the many great things about the Entity Framework. :-)
Upvotes: 7