Entity Framework Inheritance Basic question


i not getting around digging entity framework. have basic model contains following entities:

  1.  person
  2. customer (inherits person)
  3. employee (inherits person)

 i add person database:

dim dtc as new myentitymodelcontainer
dim n as new person

 

n.firstname = "john"
n.lastname = "doe" 

dtc.addtopeople(n)
dtc.savechanges()

now how tell john doe employee? know beginning:

dim dtc as new myentitymodelcontainer
dim n as new employee

n.firstname = "john"
n.lastname = "doe" 

dtc.addtopeople(n)
dtc.savechanges()

but since have john in database already, want employee, how that?

then on top of that, john both employee , customer?

what doing, have database filled "persons" , if customer or employee seperate tables "customer" table , "employee" table. have 1 pool choose "persons" know how customers , employee's



Silverlight  >  Programming Silverlight with .NET – General



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........