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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:43:15+00:00 2026-05-13T18:43:15+00:00

Say I have 3 tables in a Tennis Application (stripped down removing irrelevant info):

  • 0

Say I have 3 tables in a Tennis Application (stripped down removing irrelevant info):

Competitions

Id (PK)

Matches

Id (PK)

CompId (FK)

CourtAssignments

CompId (PK),(FK)

CourtNumber (PK)

MatchId (FK), (Unique)

To describe the above:
A match consists of 2 people playing tennis against eachother on a court.
A competition consists of 0 to many matches.

A courtassignment represents a court during a competition (During a single competition, 0 or 1 match may be assigned to a court) Also, a single match can only be played on a single court number, and exists only in a single competition. (so those two fields together form the primary key for the CourtAssignment’s table)

Thus the CourtAssignment’s MatchId field will ALWAYS be unique or null.

However, when a generate an EF Model from my database. The multiplicity for my CourtAssignment Navigation Property with my Match is *. This should be 0..1.

I am using Visual Studio 2010 beta 2 (with .Net 4 beta 2 and EF 4 beta 2).

I had been using beta 1 and was able to simply change the * to 0..1. However, now having changed to beta 2 since it has a go-live license (porting upgrading my solution worked fine, but re-writing my solution from scratch, I am unable to manuall change * to 0..1 without receiving an error:

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

Question

How can I change the multiplicity to 0..1? I know it is doable since my old solution continues to work that way. I can’t seem to make the change in the designer anymore and get completely lost in the edmx file.

Note: I realize changing MatchId to the primary key would generate the correct multiplicity, but I need my primary key to be the composite of [CompId,CourtNumber] as I need to be able to switch which match is on which court on the fly. And obviously it doesn’t work changing the primary key.

Thank you to whoever can provide help!

  • 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-13T18:43:15+00:00Added an answer on May 13, 2026 at 6:43 pm

    Scott, this isn’t the exactl same scenario as you, but it might help:

    Unique Keys not recognized by Entity Framework

    I think it may be related – perhaps you’ve got the FK cols exposed in the conceptual model? It seems you can’t do a 1 to 0..1 if this is the case.

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

Sidebar

Related Questions

Let's say I have 2 tables, Page and Application . Page always belongs to
Say I have three tables, a table of users, a table of around 500
Say we have two tables in an MS Access db: Service Users: | ID
Say I have two tables called A (fields: id, phase, name) and B(fields: id,
Say I have three tables: Fruit (Table 1) ------ Apple Orange Pear Banana Produce
Lets say I have five tables named table1, table2 ... table5. I have already
Lets say I have two tables - Cat and Cat owner that are linked
Lets say I have two tables tblA ( tableAID INT IDENTITY(1,1), foo VARCHAR(100)) tblB
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let's say I have two tables, users and notes. Let's say the schemas look

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.