views:

166

answers:

0

I have a SQL Server database and Entity Framework Model setup with POCO objects, this is working fine. However, I have also created a Sqlite database from the SQL Server database (using a simple conversion process).

So I have created another EDMX file for the SQLite database, which I would like to use my existing POCOs generated from the SQL Server model and map them to the database. Unfortunately this maps the SQLite primary key integer columns as int64 (this seems to be the underlying integer type in SQLite), when they are simply ints in the SQL Server database.

This means when I try to map the new SQLite EDMX to my existing POCO objects (generated from the SQL Server EDMX by the POCO T4 Template), the objects cannot be mapped at runtime (and throw exceptions) because the id columns differ in type.

Does anyone know of a fix for this, for example is there a way to convert values in the entity framework edmx file? If there isn't I would consider this a fairly major limitation of the entity framework.

Thanks for any assistance.