1
votes

I'm trying to have one POCO objects containing 2 tables.

I have 2 tables :

-Customer (#CustomerId, Name, CustomerProperties)
-CustomerExtended (#ExtendedId, #CustomerId, extendedProperties)

And I would have one POCO object:
Customer

- CustomerId
- Name
- CustomerProperties
- ExtendedProperties

Have you any idea?

1

1 Answers

0
votes

This is code-first solution (without fluent code).

public class Customer
{
  public int CustomerId { get; set;}
 //navigation
  public List<CustomerProperty> CustomerProperties { get; set;}
}

public class CustomerProperty
{
  public int CustomerPropertyId { get; set;}
  //navigation
  public Customer Customer { get; set; }
}

It will pruduce two tables CustomerProperties and Customers, and you can access CustomerProperties from the Customer instance.