views:

32

answers:

1

Hi,

I'm aware you can map multiple storage tables to a single entity if they have a one-to-one relationship in EF 4.0.


Example:

(storage)

(1)Table: People

Columns: Name, Age

(2)Table: Customers

Columns: Registered

--

Relationship: People <1-1> Customers

(concept)

Entity: Customers

Columns: Name, Age, Registered


I'm wondering if it's possible to do this on the "one" side of a one-to-many for ease of use on dynamic data websites?


Example:

(storage)

(1)Table: People

Columns: Name, Age

(2)Table: Customers

Columns: Registered

(3)Table: Addresses

Columns: Street City

--

Relationship: Addresses <*-1> People <1-1> Customers

(concept)

*Entity: Customers

Columns: Name, Age, Registered, Street, City


Thanks,

Carl

A: 

In general, this is called entity splitting, and there's a demo here. However, for your specific case, you might consider refactoring Address into a complex type.

Craig Stuntz
Hiya, done some pretty extensive research on the top both pre and post my question. A complex type wouldn't help in my scenario, as I was trying to create multiple conceptual models that would exactly match the forms I needed to generate for a dynamic data page. Complex types and dynamic data don't play nice, unfortunately, either. I resolved that this method isn't possible and am exploring other options. Thanks, though.
Carl

related questions