I have generated an Entity Framework model on a system that can be deployed to either an Oracle or SQL Server database. I have managed to get the EF Model working with both DB's (I have a common CSDL, the Oracle SSDL and SQL Server SSDL). I am having a problem with integers. In SQL Server fields can be defined as an integer but in Oracle they are defined as number (10,0) in order to ensure the max integer can held.
EF generates an Int32 for the SQL Server model but Int64 for Oracle. I've tried changing the CSDL to make all these fields Int64, this works fine for Oracle but not for SQL Server. I've also changed the SQL Server ssdl to make the fields in question bigints.
I get the following error
The 'propName' property on 'table name' could not be set to a 'Int32' value. You must set this property to a non-null value of type 'Int64'
I would have thought that in int field on the SQL Server DB could be assigned to a bigint/Int64 as there is no chance of a loss of data.
Without changing the DB structure (which is outside of my control) has anybody and ideas as to how to get around this issue?
Thanks.