Browse by Tags
All Tags »
ADO.NET »
Inheritance (
RSS)
EF Feature CTP5: Inheritance Scenarios with Code First Fluent API One of the interesting features of Code First fluent API is the ability to configure inheritance in your model. Since one of the strengths of an O/RM solution is its ability to map inheritance then this feature is a must in every mapping scenario (may it be Model first , Database First or Code First ). In this post I’ll show how to configure inheritance by using the fluent API. Revisiting Entity Framework Inheritance Types In the past...
Table Per Concrete Type Inheritance in Entity Framework The last inheritance mapping that I’m going to write about is the Table Per Concrete Type inheritance ( TPC ). This inheritance type is very rare but you should be aware of how to create it when it is needed. You can read about TPT and TPH from here and from here . Table Per Concrete Type Definition The TPC inheritance occurs when we have two tables with overlapping fields in the database. Such a thing can occur in situations that we create...
Table Per Hierarchy Inheritance in Entity Framework In the second inheritance mappings tutorials I’m going to write about the Table Per Hierarchy ( TPH ) inheritance mapping. If you want to read about the first mapping I showed go to the Table Per Type post from here . Table Per Hierarchy Definition In TPH the inheritance tree is create through one table only. The TPH inheritance depends on a conditional mapping which is defined by a condition such as a discriminator database field. The condition...
Table Per Type Inheritance in Entity Framework The first inheritance mapping I’m going to show is called Table Per Type or TPT . Before I start with the example lets define what is TPT . Table Per Type Definition TPT is an inheritance described in the database with separate tables. Every table provides additional details that describe a new type based on another table which is that table’s parent. In the following database ERD the OnlineCourse table is a concrete type of Course: As you can see the...
Entity Framework Inheritance Types In Sela SDP conference I was asked if Entity Framework supports inheritance mapping. The answer I gave was a small 25 minutes improvised session which I gave after the EF4 session I had. In the following three posts I’m going to explain the main three inheritance ways that you can use with EF . These ways are supported in other ORM s as well. Why to Use Inheritance? One of the ORM s main purposes is to enable us the domain developers to create a conceptual model...