Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 504801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:32:00+00:00 2026-05-13T06:32:00+00:00

I’m trying to do a Table Per Hierarchy model in Entity Framework(VS 2008 sp1,

  • 0

I’m trying to do a Table Per Hierarchy model in Entity Framework(VS 2008 sp1, 3.5).

Most of my models have been very simple, an abstract type with multiple sub-types that inherit from it.

However, I’ve been struggling with this latest challenge. I have STUDENTS that I’d like to inherit from PERSONS(abstract) that should inherity from PARTIES(abstract).

Every time I do this I get a “Error 2078: The EntityType ‘Model.PERSONS’ is Abstract and can be mapped only using IsTypeOf.” I guess the problem is PARTIES is already defined as IsTypeOf in the entity set.

So is this even possible? I can work around it by making PERSONS abstract = false and assigning a bogus conditional mapping. But this seems like a silly workaround.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:32:01+00:00Added an answer on May 13, 2026 at 6:32 am

    Edit the model using XML Editor: find the mapping and add IsTypeOf to the corresponding EntityTypeMapping tag.
    Here is an example resembling your case:
    SQL Server DDL:

    CREATE TABLE [dbo].[Student] (
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [PartyInfo] [varchar](max) NOT NULL,
        [PersonInfo] [varchar](max) NOT NULL,
        [StudInfo] [varchar](max) NOT NULL,
        CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED (  [Id] ASC  )
      )

    EDMX:

    <?xml version="1.0" encoding="utf-8"?>
    <edmx:Edmx Version="1.0" 
    xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
    <!-- EF Runtime content -->
    <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema Namespace="test_1Model.Store" Alias="Self" 
    Provider="System.Data.SqlClient" ProviderManifestToken="2005" 
    xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" 
    xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
        <EntityContainer Name="test_1ModelStoreContainer">
          <EntitySet Name="Student" EntityType="test_1Model.Store.Student" 
    store:Type="Tables" Schema="dbo" />
        </EntityContainer>
        <EntityType Name="Student">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="int" Nullable="false" 
    StoreGeneratedPattern="Identity" />
          <Property Name="PartyInfo" Type="varchar(max)" Nullable="false" />
          <Property Name="PersonInfo" Type="varchar(max)" Nullable="false" />
          <Property Name="StudInfo" Type="varchar(max)" Nullable="false" />
        </EntityType>
      </Schema>
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="test_1Model" Alias="Self" 
    xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
        <EntityContainer Name="test_Entities">
          <EntitySet Name="PartySet" EntityType="test_1Model.Party" />
        </EntityContainer>
        <EntityType Name="Party" Abstract="true">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="Int32" Nullable="false" />
          <Property Name="PartyInfo" Type="String" Nullable="false" 
    MaxLength="Max" Unicode="false" FixedLength="false" />
        </EntityType>
        <EntityType Name="Person" BaseType="test_1Model.Party" Abstract="true" >
          <Property Name="PersonInfo" Type="String" Nullable="false" />
        </EntityType>
        <EntityType Name="Student" BaseType="test_1Model.Person" >
          <Property Name="StudInfo" Type="String" Nullable="false" />
        </EntityType>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" 
    xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
        <EntityContainerMapping 
    StorageEntityContainer="test_1ModelStoreContainer" 
    CdmEntityContainer="test_Entities">
          <EntitySetMapping Name="PartySet">
            <EntityTypeMapping TypeName="IsTypeOf(test_1Model.Party)">
              <MappingFragment StoreEntitySet="Student">
                <ScalarProperty Name="PartyInfo" ColumnName="PartyInfo" />
                <ScalarProperty Name="Id" ColumnName="Id" />
              </MappingFragment>
            </EntityTypeMapping>
            <EntityTypeMapping TypeName="IsTypeOf(test_1Model.Person)">
              <MappingFragment StoreEntitySet="Student">
                <ScalarProperty Name="Id" ColumnName="Id" />
                <ScalarProperty Name="PersonInfo" ColumnName="PersonInfo" />
              </MappingFragment>
            </EntityTypeMapping>
            <EntityTypeMapping TypeName="test_1Model.Student">
              <MappingFragment StoreEntitySet="Student">
                <ScalarProperty Name="PartyInfo" ColumnName="PartyInfo" />
                <ScalarProperty Name="PersonInfo" ColumnName="PersonInfo" />
                <ScalarProperty Name="Id" ColumnName="Id" />
                <ScalarProperty Name="StudInfo" ColumnName="StudInfo" />
              </MappingFragment>
            </EntityTypeMapping>
         </EntitySetMapping>
      </EntityContainerMapping>
    </Mapping>
    </edmx:Mappings>
    </edmx:Runtime>
    <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
    <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
        <edmx:Connection>
          <DesignerInfoPropertySet>
            <DesignerProperty Name="MetadataArtifactProcessing" 
    Value="EmbedInOutputAssembly" />
          </DesignerInfoPropertySet>
        </edmx:Connection>
      <edmx:Options>
        <DesignerInfoPropertySet>
          <DesignerProperty Name="ValidateOnBuild" Value="true" />
        </DesignerInfoPropertySet>
      </edmx:Options>
      <!-- Diagram content (shape and connector positions) -->
      <edmx:Diagrams>
        <Diagram Name="SqlServer_Model" />
      </edmx:Diagrams>
    </edmx:Designer>
    </edmx:Edmx>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 427k
  • Answers 427k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Thanks to František Žiačik for the answer to this one.… May 15, 2026 at 12:55 pm
  • Editorial Team
    Editorial Team added an answer This sort of thing is rightly left out of the… May 15, 2026 at 12:55 pm
  • Editorial Team
    Editorial Team added an answer If the work is being done by other programs, there… May 15, 2026 at 12:55 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.