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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:07:29+00:00 2026-05-12T11:07:29+00:00

Can anyone help? I have a created a relationship between my Reservation(prim key) and

  • 0

Can anyone help?

I have a created a relationship between my Reservation(prim key) and Insurance(for key) tables and imported into linq2sql and checked my automatically created c# files and sure enough i have reservation.MyFieldNames etc etc PLUS reservation.Insurance which is my relationship but reservation.Insurance i can’t see the fieldnames of Insurance – am i missing something?

Do i have to call a GetInsurances or something? I don’t see anything.. In fact Insurance is of type Linq.entityset???

Also i was hoping to create my reservation table (which was nice and easy) and then automatically “INJECT” a Insurance (i.e. 1 to many) from Ilist or something..

Is this not possible,

Any help really appreciated

p.s. I did create my automatically created c# dto files via T4 Toolbox but this shouldn’t make any difference. I just have a separate file for each entity..

  • 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-12T11:07:30+00:00Added an answer on May 12, 2026 at 11:07 am

    Not 100% sure what you mean by “I don’t see anything”.

    Assuming you have a Reservations table and an Insurance table which references the “reservations” – what kind of relationship is this? 1:1 ? 1:many ? Which way around?? Can you post a screenshot of your DBML designer surface? (upload it to http://www.tinypic.com and include the link as an image here in your question)?

    The “Reservations” class will contain one instance of an “Insurance” (EntityRef<Insurance>) or a list (EntitySet) of “Insurance” objects (EntitySet<Insurance>) – depending on the nature of the relationship – and you should be able to navigate those in code, e.g.

    string foo =  myReservation.Insurance.CustomerName; // or whatever 
    

    You won’t see those on the designer surface – that’s just a link to another class somehwere on your design surface, right?

    Same goes for the other way around – if the Insurance is associated with exactly one Reservation, you should be able (in code) to do:

     string bar = myInsuranceObject.Reservation.MyFieldName1; // or whatever
    

    So it’s not quite clear to me which case you’re really referring to – can you elaborate on your question a bit more and make it clearer??

    Based on the NerdDinner sample, I’ll try to elaborate. Check out the DBML design surface:

    alt text

    Here, you don’t see any of the properties used to move back and forth between the objects. But you do see that the “RSVP” class has a “DinnerID” foreign key which links it to the “Dinner” class. So this is a 1:n relationship: one Dinner has n RSVP’s, and every RSVP is for exactly one Dinner.

    In your code, you see these created properties now – check out the RSVP class first:

    alt text

    You can see that the RSVP class has a EntityRef<Dinner> – a reference (link) to exactly one Dinner – that dinner that this RSVP is for.

    On the other hand, the Dinner class has a whole list of RSVPs of all the geek planning to attend that dinner!

    alt text

    So in the Dinner class, you have a EntitySet<RSVP> – a whole list of attendees, which you can then navigate when you’re working with your Dinner class.

    Does this make things a bit clearer?

    Marc

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

Sidebar

Ask A Question

Stats

  • Questions 235k
  • Answers 235k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer UPDATE: Hmmm, looks like this is more complex than I… May 13, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer Greg Snow's TeachingDemos package contains a dots(x, ...) function which… May 13, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer a column with a FOREIGN KEY can be nullable, but… May 13, 2026 at 6:11 am

Related Questions

I have a database that can have different types of relatinships based upon what
I'm not well versed in domain driven design and I've recently started created a
I have the following entity structure: public class Party { public Int32 PartyId {
This problem is very strange and I'm hoping someone can help me. For the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.