In my Silverlight with MVVM project, I’m using Entity Framework. I have one table named Customer, with fields CustomerID, Username, age. I have inserted one row programmatically.
Here the CustomerID field is an auto-incremented one. So how can I get the CustomerID value by passing UserName that was inserted?
Need the LINQ Query to get it from Entity Framework..?
Any Help?
The auto-incremented ID should be set in the object, after you call
SubmitChanges. That is, for example,newIdhere should contain the value:If you need to get load it subsequently from the database, then use a simple query: