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).
Exception:
The type of the key field 'ID' is expected to be 'System.Int64', but the value provided is actually of type 'System.Double'.
Stack:
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: Select all
using (MyContext myDb = new MyContext())
{
var q = myDb.OBJ;
foreach (OBJ o in q)
{
myDb.Detach(o);
myDb.Attach(o); //throws exception
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?
Thanx,
Danik