Entity Framework4, after insert POCO object, entitykey not updated
Posted: Wed 08 Dec 2010 10:11
I'm using "dotConnect for Oracle Professional 5.70.180.0" to connect Oracle10g database, after I created edmx file using VS2010, I execute:
After this, I check person.Id, it was still 0, although in database, it was 999. Why entitykey not retrieved from database?
Code: Select all
class Person
{
public string Name {get;set;}
public decimal Id {get;set;} // EntityKey
}
...
Person p = new Person{Name="Test"};
...
using(PersonContext context = new PersonContext())
{
context.Persons.AddObject(p);
context.SaveChanges();
}