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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:17:40+00:00 2026-06-14T22:17:40+00:00

I have a Entity Framework 5 Model First project, with the following tables: Extension

  • 0

I have a Entity Framework 5 Model First project, with the following tables:

Extension
  Id : Int32, PK
  Number: String

User
  Id: Int32, PK
  Name: String

UserExtensionMap
  UserId : Int32 (FK -> User.Id), PK
  ExtensionId : Int32 (FK -> Extension.Id), PK

When setting the above tables and associations to UserExtensionMap I get the error that UserId and ExtensionId are not mapped.

So I right click on UserExtensionMap table and select table mapping and get the following screen
mapping

I can set the maps for Users.Id to UserExtensionUser.Id and Extensions.Id to UserExtension.ExtensionId but there is nothing to map the Extensions.Number and User.Username to – I am confused!

I get with the error when trying to compile:

Error 3024: Problem in mapping fragments starting at line 119:Must specify mapping for all key properties (UserExtensionMaps.ExtensionId, UserExtensionMaps.UserId) of the EntitySet UserExtensionMaps.

When i delete these above maps for UserExtensionMap i get the error:

Error 3027: No mapping specified for the following EntitySet/AssociationSet - UserExtensionMaps.

My model XML file is below:

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
    <Schema Namespace="Server.Store" Alias="Self" Provider="System.Data.SqlServerCe.4.0" ProviderManifestToken="4.0" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
  <EntityContainer Name="ServerStoreContainer">
    <EntitySet Name="Users" EntityType="Server.Store.Users" store:Type="Tables" Schema="dbo" />
    <EntitySet Name="Extensions" EntityType="Server.Store.Extensions" store:Type="Tables" Schema="dbo" />
  </EntityContainer>
  <EntityType Name="Users">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="Username" Type="nvarchar" Nullable="false" />
  </EntityType>
  <EntityType Name="Extensions">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="Number" Type="nvarchar" Nullable="false" />
  </EntityType>
</Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Server" Alias="Self" p1:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:p1="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityContainer Name="ServerEntities" p1:LazyLoadingEnabled="true" >
          <EntitySet Name="Users" EntityType="Server.User" />
          <EntitySet Name="Extensions" EntityType="Server.Extension" />
          <EntitySet Name="UserExtensionMaps" EntityType="Server.UserExtensionMap" />
          <AssociationSet Name="ExtensionUserExtensionMap" Association="Server.ExtensionUserExtensionMap">
            <End Role="Extension" EntitySet="Extensions" />
            <End Role="UserExtensionMap" EntitySet="UserExtensionMaps" />
          </AssociationSet>
          <AssociationSet Name="UserUserExtensionMap" Association="Server.UserUserExtensionMap">
            <End Role="User" EntitySet="Users" />
            <End Role="UserExtensionMap" EntitySet="UserExtensionMaps" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="User">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Type="String" Name="Username" Nullable="false" />
          <NavigationProperty Name="UserExtensionMaps" Relationship="Server.UserUserExtensionMap" FromRole="User" ToRole="UserExtensionMap" />
        </EntityType>
        <EntityType Name="Extension">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Type="String" Name="Number" Nullable="false" />
          <NavigationProperty Name="UserExtensionMaps" Relationship="Server.ExtensionUserExtensionMap" FromRole="Extension" ToRole="UserExtensionMap" />
        </EntityType>
        <EntityType Name="UserExtensionMap" >
          <Key>
            <PropertyRef Name="ExtensionId" />
            <PropertyRef Name="UserId" />
          </Key>
          <NavigationProperty Name="Extension" Relationship="Server.ExtensionUserExtensionMap" FromRole="UserExtensionMap" ToRole="Extension" />
          <Property Type="Int32" Name="ExtensionId" Nullable="false" />
          <NavigationProperty Name="User" Relationship="Server.UserUserExtensionMap" FromRole="UserExtensionMap" ToRole="User" />
          <Property Type="Int32" Name="UserId" Nullable="false" />
        </EntityType>
        <Association Name="ExtensionUserExtensionMap">
          <End Type="Server.Extension" Role="Extension" Multiplicity="1" />
          <End Type="Server.UserExtensionMap" Role="UserExtensionMap" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Extension">
              <PropertyRef Name="Id" />
            </Principal>
            <Dependent Role="UserExtensionMap">
              <PropertyRef Name="ExtensionId" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="UserUserExtensionMap">
          <End Type="Server.User" Role="User" Multiplicity="1" />
          <End Type="Server.UserExtensionMap" Role="UserExtensionMap" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="User">
              <PropertyRef Name="Id" />
            </Principal>
            <Dependent Role="UserExtensionMap">
              <PropertyRef Name="UserId" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
    <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
  <EntityContainerMapping StorageEntityContainer="ServerStoreContainer" CdmEntityContainer="ServerEntities">
    <EntitySetMapping Name="Users">
      <EntityTypeMapping TypeName="IsTypeOf(Server.User)">
        <MappingFragment StoreEntitySet="Users">
          <ScalarProperty Name="Id" ColumnName="Id" />
          <ScalarProperty Name="Username" ColumnName="Username" />
        </MappingFragment>
      </EntityTypeMapping>
    </EntitySetMapping>
    <EntitySetMapping Name="Extensions">
      <EntityTypeMapping TypeName="IsTypeOf(Server.Extension)">
        <MappingFragment StoreEntitySet="Extensions">
          <ScalarProperty Name="Id" ColumnName="Id" />
          <ScalarProperty Name="Number" ColumnName="Number" />
        </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/2009/11/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="True" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams></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-06-14T22:17:41+00:00Added an answer on June 14, 2026 at 10:17 pm

    I could not see the table mapping fields until I generated the database code right click model -> Generate Database from model, after doing this the mappings were OK.

    Not sure if this is a bug or not, but it is repeatable and does fix the issue.

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

Sidebar

Related Questions

In my application I'm using Entity Framework 4.0 Model First. I have several tables
We have an entity framework model with has some inheritance in it. The following
I have a simple ADO.NET Entity Framework 4.0 model (edmx) which defines database tables
I have a entity framework database first project. here is a extraction of the
I've enabled code-first migrations on my entity framework project, and have added several migrations
I have built up a code-first model using Entity Framework 5. The classes have
I have a project using Entity Framework code first. For various reasons one of
I have developed a project using MVC3 and Code first Entity Framework 4.0 as
I'm using Entity Framework and MVC3, I have used Model First approch... I have
I have an Entity Framework data model. Part of the model is a Customer

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.