Entity Framework4, after insert POCO object, entitykey not updated

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
leishen
Posts: 16
Joined: Mon 20 Sep 2010 09:19

Entity Framework4, after insert POCO object, entitykey not updated

Post by leishen » 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:

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();
}
After this, I check person.Id, it was still 0, although in database, it was 999. Why entitykey not retrieved from database?

leishen
Posts: 16
Joined: Mon 20 Sep 2010 09:19

Post by leishen » Wed 08 Dec 2010 13:35


Post Reply