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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:20:38+00:00 2026-05-23T20:20:38+00:00

I have two tables in a database. One is for a member and one

  • 0

I have two tables in a database. One is for a member and one is for a client. The client table has two columns for who created the row, and who has modified the row. Foreign keys were set up from each column to map back to the member table. All of this makes sense until
one runs Entity Framework against the database and I get the following code generated for me.

public Member()
{
   public virtual ICollection<Client> Clients { get; set; }
   public virtual ICollection<Client> Clients1 { get; set; }
}

public Client()
{
   public virtual Member MemberForCreated { get; set; }
   public virtual Member MemberForModified { get; set; }
}

My question is why would Entity Framework think to make a backing collection in the member table for each foreign key relationship to the client table? Do I really need this relationship or is this something that I can remove? Any information would be useful.

As a side note: These collections and relationships are found in the .edmx file under the navigation properties collection of the entities.

  • 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-23T20:20:39+00:00Added an answer on May 23, 2026 at 8:20 pm

    EF relationships are bidirectional by default. You can remove either direction if you don’t need it.

    You can also rename them. You might, e.g., want to call them Member.ClientsCreated and Member.ClientsModified.

    Julie Lerman has a video examining unidirectional relationships.

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

Sidebar

Related Questions

I have two tables in my database: NEWS table with columns: id - the
I have two database tables, 'Lists' and 'Notes'. Lists has columns _id, listname Notes
I have two related tables in my database: Page and Tag. One Page can
I have two simple tables in my database. A card table that contains Id,
I have a SQL Server 2008 database that has two tables. These two tables
I have two database tables, one for Users of a web site, containing the
I have two tables in my database, one for In and one for Out
I have two tables in my database, 1st one contains a couple of sentences,
i have two tables in my database one is A other one is B
I have two MySQL database tables: one containing a list of championships and another

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.