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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:51:55+00:00 2026-05-27T10:51:55+00:00

Using Entity Framework 4.1 I have the following tables I’m using with Entity Framework

  • 0

Using Entity Framework 4.1

I have the following tables I’m using with Entity Framework

  • User ( UserId PK identity, UserName, Password )

  • Physician ( PhysicianId unique identity, UserId refereces User PK, PhysicianName )

  • PhysicianSite ( SiteId, Location, PhysicianId FK to Physician table)

Problem. Entity Framework would not allow me to associate Physician with PhysicianSite because PhysicianId is not the primary key on the Physician table.

User is the base of Physician because my application has other types Users, such as Patients.

I get the following error

Error 2 Error 113: Multiplicity is not valid in Role ‘Physician’ in relationship ‘PhysicianSitePhysician’. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be *.

Could someone tell me how I can create the association with Physician to PhysicianSite in Entity Framework without PhysicianId being the primary key on the Physician table?

  • 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-27T10:51:56+00:00Added an answer on May 27, 2026 at 10:51 am

    Entity Framework requires foreign keys to link to a table’s primary key. However, the primary key to Entity Framework does not have to match the primary key in the database. If you tell EF the PhysicianId is the primary key, it won’t go checking if it really is. And it will happily accept foreign keys to the PhysicianId.

    If you have some foreign keys to PhysicianId, and others to the real primary key, you’re out of luck, but it doesn’t seem like you do.

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

Sidebar

Related Questions

I have a problem with the following Linq query using Entity Framework: from o
Trying to map the following schema using the Entity Framework. A Customer can have
Using the Entity Framework Code First paradigm I have defined the following objects and
I'm using Entity Framework in my project, and I have the problem that, once
I am using Entity Framework with my website. To improve performance, I have started
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
Can anyone help? I have been using the entity framework and its going well
So, I am using the Linq entity framework. I have 2 entities: Content and
I have an app using the ADO.NET entity framework (the VS2008 version, not the
Using ASP MVC and Entity Framework. In the view, you have a page declaration

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.