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

  • Home
  • SEARCH
  • 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 6644695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:11:49+00:00 2026-05-26T00:11:49+00:00

As the title indicates I am looking for the solution to this with the

  • 0

As the title indicates I am looking for the solution to this with the Association attribute also the property for the EntitySet<> setter since it differs for the Many To Many relationship I am not sure I am going in the right direction with since there are no examples of said relationship, due to L2S being very difficult with this type of relation.

Does the Foreign Key table have to have references or sets to the 2 tables that it joins…?

Example:

  • Hotels – Table
  • ScheduledFlights – Table
  • HotelToScheduledFlights – Table — consists of HotelId & ScheduledFlightId both are FKs

Do I use a many to many in this case? or would I better off refactoring to a one to many?

  • 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-26T00:11:50+00:00Added an answer on May 26, 2026 at 12:11 am

    If the foreign key relationships exists in SQL, L2S will have both the properties (ex HotelId, ScheduledFlightId) and the EntityRefs in the HotelToScheduledFlights table object. Hotels will then have an EntitySet pointing to HotelToScheduledFlights as will ScheduledFlights.

    I think that this is a valid many to many relationship, so long as you are planning on needing to find hotels by flight and flights by hotel.

    To get all of the flights tied to a hotel you would do:

    Hotel h = dc.Hotels.First(); // Pick a hotel
    List<ScheduledFlight> l = h.HotelToScheduledFlight.Select(i => i.ScheduledFlight).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me better explain this title. What I am looking for is an image
As the title indicates, are there any C/C++ bytecode compilers/interpreters? I'm writing an application
Title is the entire question. Can someone give me a reason why this happens?
The title says it. I'm looking for a way to determine exactly which file/registry
As the title indicates I have an MVC 2 Application running on Server 2003.
I didn't really know how to formulate the title. But this is my problem.
I have a WPF Data Grid (From the WPF Toolkit as the title indicates)
In a typical many-many arrangement like this... Movies Actors Movies_Actors ------ ------ ------------- movie_ID
Good morning. As the title indicates, I've got some questions about using python for
I think the title is pretty clear. I have ran into this twice now.

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.