getting identity of the saved record

getting identity of the saved record

                        Feature feature = new Feature();                         feature.vcr_FeaturesName = AddedNode.ToString();                         feature.int_ParentId = 0;                         feature.int_CreatedBy = 1;                         feature.dtm_CreatedDate = DateTime.Now;                         FeatureRepository.Add(feature);                         FeatureRepository.Save(); 

i am using linq how would i going to get the identity in the code above.

VS 2010 MVC Formatting


ASP.NET MVC Membership, Get new UserID
When you call submitchanges() in LINQ to SQL, it refreshes the key; think that's the same for LINQ to entities.

ASP.NET MVC 2 - Saving child entities on form submit
Your code is wrapping this process but what are those methods doing?.
what is the optimal database connection strategy

Working with images in MVC ViewMasterPage in design mode

73 out of 100 based on 73 user ratings 523 reviews