Entity Framework - splitting entity across multiple tables

Posts   
 
    
chand
User
Posts: 72
Joined: 05-Aug-2007
# Posted on: 17-Aug-2010 01:50:40   

It looks like LLBLGen designer doesn't support this scenario, where Visual Studio supports this.

Is there any work around for this?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Aug-2010 07:07:59   

Hi chad,

So you have EntityA, and its targets tables are TableA1 and TableA2. If I'm not mistaken, this will be added in the 1st oficial v3 update (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15441&StartAtMessage=0&#86018).

Workaround: you can create DB Views an map them as entities. Also you can create TypedList. Does this work for you?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 17-Aug-2010 10:10:29   

Indeed, we cut this from v3.0 because the model-first scenario was too complex to get it done on time, so we postponed it to a later v3.x version (3.1, 3.2 etc.) It will be added, it's not said when.

That said, in general one should strive for a domain model which is more fine grained than the tables it's mapped on. mapping an entity onto multiple tables does the opposite, so it might be you really shouldn't do this? (i.o.w.: you only really need this if the tables involved are all mandatory for an entity and you don't want to use inheritance (TPE). In general separate tables for an entity suggest 'optional' data, normalized out to a separate table.

Frans Bouma | Lead developer LLBLGen Pro