Map Entity To Multiple Tables

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
MichaelH
Posts: 6
Joined: Tue 22 Nov 2011 20:57

Map Entity To Multiple Tables

Post by MichaelH » Wed 29 Feb 2012 23:18

Is there a way to map an entity (Code First) using attributes to multiple tables?

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by MariiaI » Fri 02 Mar 2012 14:15

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.

Post Reply