Print Page | Close Window

What is DevForce EF's approach to mapping OO Inheritance?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=921
Printed Date: 06-Sep-2025 at 3:06pm


Topic: What is DevForce EF's approach to mapping OO Inheritance?
Posted By: sebma
Subject: What is DevForce EF's approach to mapping OO Inheritance?
Date Posted: 21-Aug-2008 at 11:24pm
Hi All,
Perhaps I have missed some details from DevForce EF documentation, or the Developers Guide in particular.
 
In C#, I hand coded my OO inheritance mapping (Table per Hierarchy way) with class attribute like the following to a database table like:

    [Table(Name="dbo.MyTable")]
    [InheritanceMapping(Code = 1, Type = typeof(MyBase), IsDefault = true)]
    [InheritanceMapping(Code = 2, Type = typeof(MyDerive1))]
    [InheritanceMapping(Code = 3, Type = typeof(MyDerive2))]
    [InheritanceMapping(Code = 4, Type = typeof(MyDerive3))]

Is there a known DevForce EF approach for these O/R impedance mapping?
 
Thanks!
Sebastian



Replies:
Posted By: kimj
Date Posted: 24-Aug-2008 at 4:43pm
DevForce EF piggybacks on the inheritance features provided by the Entity Framework data model.  Take a look at http://blogs.msdn.com/adonet/archive/2007/03/15/inheritance-in-the-entity-framework.aspx - http://blogs.msdn.com/adonet/archive/2007/03/15/inheritance-in-the-entity-framework.aspx  on the ADO.NET team blog for more information on what can be done in EF. 
 
Although not yet ready as a tutorial, we do have a sample showing models built using TPT (table per type), TPH (table per hierarchy) and TPC (table per concrete type) which is available upon request.  Email support if interested.


Posted By: sebma
Date Posted: 24-Aug-2008 at 9:11pm
Will email support for sample models, thank-you kimj



Print Page | Close Window