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 541257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:19:29+00:00 2026-05-13T10:19:29+00:00

I tried this: http://channel9.msdn.com/posts/RobBagby/deCast-Entity-Framework-Modeling-Implementing-Entity-Splitting/Default.aspx?wa=wsignin1.0 …with the Northwind sample database from Codeplex, using the Employee

  • 0

I tried this:
http://channel9.msdn.com/posts/RobBagby/deCast-Entity-Framework-Modeling-Implementing-Entity-Splitting/Default.aspx?wa=wsignin1.0

…with the Northwind sample database from Codeplex, using the Employee and Contact tables. I wanted to create a EmployeeContact entity that basically pulls in the FirstName and LastName columns from the Contact. So I copied and pasted these properties and the ContactID property from the Contact entity to the Employee entity. I mapped all of these but I now get an error about mapping the EmployeeID property:

“Error 3024: Problem in mapping fragments starting at line 389:Must specify mapping for all key properties (Employees.EmployeeID) of the EntitySet Employees.”

And for that matter, how do I get VS to show me the markup for the mapping file instead of showing me the designer? At least maybe then I could begin to see the source of the error since it references a specific line number.

This property is mapped, in that the Mapping Details view shows an assignment from table column to entity property of the same name, which was already generated that way for me. It took me a good bit to get to this point, and it is frustrating that creating what would normally be a simple join is so problematic. I hate to imagine the problems one runs in to doing anything even slightly more complex.

I’m sure someone will suggest I use LINQ, but I thought the whole purpose of the Entity Framework was to make it so you thought more about the meaning of data and less about the relational structure? In other words, not having to do numerous joins everytime you wanted a simple set of data.

Thanks in advance.

Here is me edmx file, I have stripped down the mappings section to try and get it to compile:

<?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="AdventureWorksModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
        <EntityContainer Name="AdventureWorksModelStoreContainer">
          <EntitySet Name="Employee" EntityType="AdventureWorksModel.Store.Employee" store:Type="Tables" Schema="HumanResources" />
          <EntitySet Name="Contact" EntityType="AdventureWorksModel.Store.Contact" Schema="Person" store:Type="Tables" />
          <AssociationSet Name="FK_Employee_Contact_ContactID" Association="AdventureWorksModel.Store.FK_Employee_Contact_ContactID">
            <End EntitySet="Contact" Role="Contact" />
            <End EntitySet="Employee" Role="Employee" />
          </AssociationSet>
          <AssociationSet Name="FK_Employee_Employee_ManagerID" Association="AdventureWorksModel.Store.FK_Employee_Employee_ManagerID">
            <End Role="Employee" EntitySet="Employee" />
            <End Role="Employee1" EntitySet="Employee" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Employee">
          <Key>
            <PropertyRef Name="EmployeeID" />
          </Key>
          <Property Name="EmployeeID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="NationalIDNumber" Type="nvarchar" Nullable="false" MaxLength="15" />
          <Property Name="ContactID" Type="int" Nullable="false" />
          <Property Name="LoginID" Type="nvarchar" Nullable="false" MaxLength="256" />
          <Property Name="ManagerID" Type="int" />
          <Property Name="Title" Type="nvarchar" Nullable="false" MaxLength="50" />
          <Property Name="BirthDate" Type="datetime" Nullable="false" />
          <Property Name="MaritalStatus" Type="nchar" Nullable="false" MaxLength="1" />
          <Property Name="Gender" Type="nchar" Nullable="false" MaxLength="1" />
          <Property Name="HireDate" Type="datetime" Nullable="false" />
          <Property Name="SalariedFlag" Type="bit" Nullable="false" />
          <Property Name="VacationHours" Type="smallint" Nullable="false" />
          <Property Name="SickLeaveHours" Type="smallint" Nullable="false" />
          <Property Name="CurrentFlag" Type="bit" Nullable="false" />
          <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" />
          <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
        </EntityType>
        <EntityType Name="Contact">
          <Key>
            <PropertyRef Name="ContactID" />
          </Key>
          <Property StoreGeneratedPattern="Identity" Name="ContactID" Nullable="false" Type="int" />
          <Property Name="NameStyle" Nullable="false" Type="bit" />
          <Property Name="Title" MaxLength="8" Type="nvarchar" />
          <Property Name="FirstName" Nullable="false" MaxLength="50" Type="nvarchar" />
          <Property Name="MiddleName" MaxLength="50" Type="nvarchar" />
          <Property Name="LastName" Nullable="false" MaxLength="50" Type="nvarchar" />
          <Property Name="Suffix" MaxLength="10" Type="nvarchar" />
          <Property Name="EmailAddress" MaxLength="50" Type="nvarchar" />
          <Property Name="EmailPromotion" Nullable="false" Type="int" />
          <Property Name="Phone" MaxLength="25" Type="nvarchar" />
          <Property Name="PasswordHash" Nullable="false" MaxLength="128" Type="varchar" />
          <Property Name="PasswordSalt" Nullable="false" MaxLength="10" Type="varchar" />
          <Property Name="AdditionalContactInfo" Type="xml" />
          <Property Name="rowguid" Nullable="false" Type="uniqueidentifier" />
          <Property Name="ModifiedDate" Nullable="false" Type="datetime" />
        </EntityType>
        <Association Name="FK_Employee_Contact_ContactID">
          <End Type="AdventureWorksModel.Store.Contact" Multiplicity="1" Role="Contact" />
          <End Type="AdventureWorksModel.Store.Employee" Multiplicity="*" Role="Employee" />
          <ReferentialConstraint>
            <Principal Role="Contact">
              <PropertyRef Name="ContactID" />
            </Principal>
            <Dependent Role="Employee">
              <PropertyRef Name="ContactID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Employee_Employee_ManagerID">
          <End Role="Employee" Type="AdventureWorksModel.Store.Employee" Multiplicity="0..1" />
          <End Role="Employee1" Type="AdventureWorksModel.Store.Employee" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Employee">
              <PropertyRef Name="EmployeeID" />
            </Principal>
            <Dependent Role="Employee1">
              <PropertyRef Name="ManagerID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="AdventureWorksModel" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
        <EntityContainer Name="AdventureWorksEntities">
          <EntitySet Name="EmployeeContacts" EntityType="AdventureWorksModel.EmployeeContact" />
          </EntityContainer>
        <EntityType Name="EmployeeContact">
          <Key>
            <PropertyRef Name="ContactID" />            
          </Key>
          <Property Name="EmployeeID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="NationalIDNumber" Type="String" Nullable="false" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="LoginID" Type="String" Nullable="false" MaxLength="256" Unicode="true" FixedLength="false" />
          <Property Name="Title" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
          <Property Name="BirthDate" Type="DateTime" Nullable="false" />
          <Property Name="MaritalStatus" Type="String" Nullable="false" MaxLength="1" Unicode="true" FixedLength="true" />
          <Property Name="Gender" Type="String" Nullable="false" MaxLength="1" Unicode="true" FixedLength="true" />
          <Property Name="HireDate" Type="DateTime" Nullable="false" />
          <Property Name="SalariedFlag" Type="Boolean" Nullable="false" />
          <Property Name="VacationHours" Type="Int16" Nullable="false" />
          <Property Name="SickLeaveHours" Type="Int16" Nullable="false" />
          <Property Name="CurrentFlag" Type="Boolean" Nullable="false" />
          <Property Name="rowguid" Type="Guid" Nullable="false" />
          <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
          <Property Type="String" Name="FirstName" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Type="String" Name="MiddleName" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Type="String" Name="LastName" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Type="Int32" Name="ContactID" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
        </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="AdventureWorksModelStoreContainer" CdmEntityContainer="AdventureWorksEntities">
          <EntitySetMapping Name="EmployeeContacts">            
            <EntityTypeMapping TypeName="IsTypeOf(AdventureWorksModel.EmployeeContact)">              
              <MappingFragment StoreEntitySet="Employee">
                <Condition ColumnName="ContactID" IsNull="false"/>                
                <ScalarProperty Name="ContactID" ColumnName="ContactID"/>
                </MappingFragment>
              <MappingFragment StoreEntitySet="Contact">
                <ScalarProperty Name="ContactID" ColumnName="ContactID"/>
                </MappingFragment>
            </EntityTypeMapping>
            </EntitySetMapping>
          </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
    <Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </Connection>
    <Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
        <DesignerProperty Name="EnablePluralization" Value="True" />
        <DesignerProperty Name="IncludeForeignKeysInModel" Value="False" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="Model1" ZoomLevel="70">
        <EntityTypeShape EntityType="AdventureWorksModel.EmployeeContact" Width="1.5" PointX="3.25" PointY="0.5" Height="4.480205078125" IsExpanded="true" />
        </Diagram></Diagrams>
  </Designer>
</edmx:Edmx>
  • 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-13T10:19:29+00:00Added an answer on May 13, 2026 at 10:19 am

    I kind of gave up on this, realizing that it doesn’t seem to be intended to be used this way. Instead I will just settle with traversing the Navigation Properties, which is like doing a join, except in an easier OO fashion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Indexing a QuerySet results in a single model, if any… May 13, 2026 at 3:27 pm
  • Editorial Team
    Editorial Team added an answer var splitString = yourstring.split(','); See split var str = "test,test1,test2";… May 13, 2026 at 3:27 pm
  • Editorial Team
    Editorial Team added an answer $('table.listings:contains("You") td:nth-child(2)').addClass("highlight"); May 13, 2026 at 3:27 pm

Related Questions

I am trying to read an Http response stream twice via the following: HttpWebResponse
So I need to access this service from my rails app. I'm using soap4r
I have a WCF service hosted in IIS 7 using HTTPS. When I browse
I know the ideal place to ask is at . I posted my question
I need to get access to the iTunes tags in an RSS feed using

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.