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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:19:47+00:00 2026-05-20T11:19:47+00:00

Maybe I have just designed this incorrectly, and if so I am more than

  • 0

Maybe I have just designed this incorrectly, and if so I am more than happy to bow out and loot at it another way…

I currently have 2 tables like this, which have a shared primary key:

person – id (PK), name, created_date, …

person_details – person_id (PK), age, height, …

Now the person gets created and a person can only have one set of details. So initially I thought that when mapping the person_details I would have the PK as being assigned, as it would be generated by the person.

Now im just a bit confused as to how I can create the first instance of this data in the database, as when I create a Person model, which contains an instance of PersonDetails model, neither will have an Id at this point, as they haven’t been created. So how do I tell the PersonDetails model to take its Id from the Parent Person model when creating?

Am I just going mad or is there a simple mapping I need to do in the Person model to tell it to infer the PersonDetails Id when inserting from its own Id? I end up needing the Person_Id on the PersonDetails as they are updated externally to the person by Ajax if a change will be made after initial creation…

  • 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-20T11:19:47+00:00Added an answer on May 20, 2026 at 11:19 am

    If the tables share a PK (which I assume is originated in person), then you have either a one-to-one, where a Person has a Detail, or a join, where a Person has Age, Height, etc and they are mapped into a different table.

    Just read both chapters, they have examples.

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

Sidebar

Related Questions

Maybe I just don't know .NET well enough yet, but I have yet to
I have a little dilemma that maybe you can help me sort out. I've
I have some C++ source code with templates maybe like this - doxygen runs
Maybe this is a dumb question, but I have the following behavior in Visual
I have a table that contains maybe 10k to 100k rows and I need
I have been thinking of maybe writing a little tool that logs into SO
If I have sequence of sequences (maybe a list of tuples) I can use
I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every
Maybe world peace would be easier, but I have a problem with the widths
I have a huge mbox file, with maybe 500 emails in it. It looks

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.