locked
EF Code First and composite application (CAB) RRS feed

  • Question

  • hi,

    I have done some testing to see whether I could use EF 4.2 for an extensible application. So far I was able to extend my DB-Model by using the Fluent API to add new entities and relations from multiple Assemblies. So far, so good. But how can I extend existing entities/tables with new columns? The sample shown in entity-splitting (http://weblogs.asp.net/manavi/archive/2011/04/24/associations-in-ef-4-1-code-first-part-4-table-splitting.aspx) is basically what I would like (multiple entities persisiting to the same table), but I cannot add a property in the original entity being extended.

    Sample:

    Entity 'Patient' in Base-Assembly (A) should be extended in a customer-specific assembly (B) by Entity 'PatientExtension' with some new properties.

    A new feature for the complete application (in Assembly C) - a schedule component - extends 'Patient' from Assembly A aswell with some scheduling specific information in entity 'PatientSchedulingInformationExtension'.

    Wether all information is stored in the same table or not, I don't really care (although I'd like to be able to choose that, if possible). But it should result in a right relation. When the 'Patient' record is deleted, all information (including that of the extensions) must be completely removed.

     


    regards, Tilli
    Sunday, January 8, 2012 5:26 PM

All replies