SO I read here In Entity Framework, getting the value of an identity column after inserting that if you do this :
var entity = new Entity_Table { item1 = val1, item2 = val2 };
dbcontext.Entity_Tables.Add(entity);
dbcontext.SaveChanges();
int newPK = entity.ID;
You can get the identity of the row you inserted. However, entity.ID does not appear in my sceneario.
My sceneario: 1. I build the database with a sql script 2. Then I read it as a edmx file 3. Then I ADO.NET DbContext Generator which creates NameOfMyEntity.Context.tt and NameOfMyEntity.tt
I can insert, update and delete successfully. But I cant see entity.ID. I receive no errors on runtime or compile time!@ Please help!