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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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. 🙂