Waheed
Waheed

Reputation: 10216

Get Newly generated ID (i.e. scopeIdentity) in Entity FrameWork

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

Answers (1)

Prutswonder
Prutswonder

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

Related Questions