c# - How to model collection of mixed entities using EF code first -



c# - How to model collection of mixed entities using EF code first -

i'm using ef5 in vs2010. have working sample 2 types: person, business i'd add together collection like

dbset<customer> customers

where objects in customers can either person or business. in app i'd able like:

mycontext.customers.add(new person()); mycontext.customers.add(new business());

i think client table like

id (id of person or business) discriminator

how can achieved code first?

create base-class customers id property , derive person , business customers?

c# ef-code-first entity-framework-5

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -