Custom mapping is obviously not reflected in the Entity Framework designer
900715Nov 23 2011 — edited Nov 25 2011Hi,
I use the Oracle Data Provider for .NET 11.2.0.2.50 Beta 3 with the Entity Framework. I added a custom mapping to the app.config that maps NUMBER(1,0) to bool:
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
</settings>
</oracle.dataaccess.client>
When I create an Entity Framework model from my Oracle database the EF designer uses Int16 for NUMBER(1,0) fields instead of bool. If I run the program I then get an exception (as expected):
"Schema specified is not valid. Errors:
EntityFrameworkTest.msl(7,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.Int16[Nullable=True,DefaultValue=]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.CUSTOMER' is not compatible with 'OracleEFProvider.number[Nullable=True,DefaultValue=,Precision=1,Scale=0]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.Store.CUSTOMERS'."
Okay. Assuming it's an error in the EF designer, I set the type Boolean in the model myself for the NUMBER(1,0) fields. But that gives me a compilation error:
"Error 2019: Member Mapping specified is not valid. The type 'Edm.Boolean[Nullable=True,DefaultValue=]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.CUSTOMER' is not compatible with 'OracleEFProvider.number[Nullable=True,DefaultValue=,Precision=1,Scale=0]' of member 'ISVIPCUSTOMER' in type 'EntityFrameworkTestModel.Store.CUSTOMERS'."
Is this a bug in the provider? Or am I missing something?