tags:

views:

17

answers:

1
                        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.

A: 

When you call submitchanges() in LINQ to SQL, it refreshes the key; think that's the same for LINQ to entities. Your code is wrapping this process but what are those methods doing?

Brian