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
Post a Comment