Multiple entities
Posted: Mon 12 Mar 2012 18:39
Hi to all,
I am making a software that is able to handle local and remote databases. The local one is an SQLite , the remote is an PostgreSQL database. The handling of databases is implemented into a DLL.
As far as the structure, these two databases are the same: same tables, tables have the same columns.
My initial imagination was that I would make two models with Entity Developer. One modell would handle the first, the other would handle the second database. I got into the fault that since table names are the same, these two modells cannot fit into the same project, because duplications occure due to same names.
It is not hard to rename classes with a prefix in the following way: lTable1, lTablle2, … rTable1, rTable2, or use different namespaces, but I would avoid this method if possible.
Is there any regular solution for this?
Thanks:
Imre
I am making a software that is able to handle local and remote databases. The local one is an SQLite , the remote is an PostgreSQL database. The handling of databases is implemented into a DLL.
As far as the structure, these two databases are the same: same tables, tables have the same columns.
My initial imagination was that I would make two models with Entity Developer. One modell would handle the first, the other would handle the second database. I got into the fault that since table names are the same, these two modells cannot fit into the same project, because duplications occure due to same names.
It is not hard to rename classes with a prefix in the following way: lTable1, lTablle2, … rTable1, rTable2, or use different namespaces, but I would avoid this method if possible.
Is there any regular solution for this?
Thanks:
Imre