Page 1 of 1

Map Entity To Multiple Tables

Posted: Wed 29 Feb 2012 23:18
by MichaelH
Is there a way to map an entity (Code First) using attributes to multiple tables?

Posted: Fri 02 Mar 2012 14:15
by MariiaI
Please specify which ORM you are using. Am I correct supposing that this is LinqConnect?

As for mapping several tables to a single entity, please specify whether you mean mapping all rows to a single entity type (like it is done when joining tables) or loading the same or similar rows from multiple tables (like 'union' does). In the first case, it is only possible with the means of the TPT inheritance:
- specify the base type for the first table;
- determine a new descendant class for each additional table;
- in your code work only with the last descendant.