I am considering to use EF to access legacy SQL Server databases installed on our customers' systems.
The problem is that the databases schemas are not 100% consistent: While they all have the same (relevant) tables and fields, some numeric fields might have different data types.
As far as I can see, the types are "compatible" from an application point of view: E.g. a field containing small numbers might be a smallint
on customer A's database, but an int
on customer B's database, or a field containing a price might be a decimal(10,2)
on A's database but a float
on B's database (yes, that means that B might suffer from floating-point problems -- it's a legacy database after all).
Since we are not the only ones accessing the databases, changing (and, thus, unifying) the schemas is not an option. Is Entity Framework able to cope with that (i.e., will it gracefully accept a double
in the SQL Server table if the model definition claimed it's a decimal(10,2)
) or will it crash horribly?