Entities generated EntityKey bad type for Number(16,0)

Entities generated EntityKey bad type for Number(16,0)

Postby danik » Thu 17 Jul 2008 15:51

I have some table in DB with its ID of type Number(16,0). It is mapped to Int64 in both ssdl and csdl. But type of value in o.EntityKeyValues[0].Value is double. That is problem for Detach-Atach scenario (for example for 3-layer editing).

The type of the key field 'ID' is expected to be 'System.Int64', but the value provided is actually of type 'System.Double'.

Code: Select all
   at System.Data.EntityKey.ValidateEntityKey(EntitySet entitySet)
   at System.Data.Objects.ObjectContext.AttachTo(String entitySetName, Object entity)
   at System.Data.Objects.ObjectContext.Attach(IEntityWithKey entity)

Code to reproduce ) note that ID is Number(16,0) in database:
Code: Select all
            using (MyContext myDb = new MyContext())           
                var q = myDb.OBJ;
                foreach (OBJ o in q)
                    myDb.Attach(o); //throws exception

Values in watches:
o.EntityKeyValues[0].Value - 100000961438.0 object {double}
o.ID - 100000961438 long

Version of OraDirects: 4.70.37
EF version from SP1 beta3

Any idea?

Posts: 3
Joined: Thu 17 Jul 2008 15:30

Postby AndreyR » Fri 18 Jul 2008 11:25

Hello, Danik.

Thank you for the bug report. The issue is fixed, look forward for the next build.

Regards, Andrey.
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Return to dotConnect for Oracle