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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:47:28+00:00 2026-05-26T05:47:28+00:00

I am just doing a small application with 3 tables. Applicants Positions ApplicantsPerPosition. This

  • 0

I am just doing a small application with 3 tables.

Applicants
Positions
ApplicantsPerPosition.

This last one would be a many to many relationship with the other 2 tables.

However I am using CODE First approach, but I am not sure if I what I am doing code is correct or not.

I added a ICollection and ICollection in the other 2 tables.

Is this correct or not? I did it this way, to be able to navigate through the properties of associated objects easily, however I am not sure if at the end this will be translated into 3 tables only as I would do it in a DATABASE First approach.

Example code is here:

public class Position
    {
        public int id { get; set; }
        [StringLength(20, MinimumLength=3)]
        public string name { get; set; }
        public int yearsExperienceRequired { get; set; }
        public virtual ICollection<ApplicantPosition> applicantPosition { get; set; }
    }

    public class Applicant
    {
        public int ApplicantId { get; set; }
        [StringLength(20, MinimumLength = 3)]
        public string name { get; set; }
        public string telephone { get; set; }
        public string skypeuser { get; set; }
        public ApplicantImage photo { get; set; }
        public virtual ICollection<ApplicantPosition> applicantPosition { get; set; }

    }

    public class ApplicantPosition
    {
        public virtual ICollection<Position> appliedPositions { get; set; }
        public virtual ICollection<Applicant> applicants { get; set; }
        public DateTime appliedDate { get; set; }
        public int StatusValue { get; set; }

        public Status Status
        {
            get { return (Status)StatusValue; }
            set { StatusValue = (int)value; }
        }


    }
  • 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-26T05:47:29+00:00Added an answer on May 26, 2026 at 5:47 am

    If you are modeling the join table as a separate entity then you have one-to-many relationships between that entity and the other 2 entities. You also need to expose the primary key columns as properties in the link entity.

    public class Position
    {
        public int id { get; set; }
        [StringLength(20, MinimumLength=3)]
        public string name { get; set; }
        public int yearsExperienceRequired { get; set; }
        public virtual ICollection<ApplicantPosition> applicantPosition { get; set; }
    }
    
    public class Applicant
    {
        public int ApplicantId { get; set; }
        [StringLength(20, MinimumLength = 3)]
        public string name { get; set; }
        public string telephone { get; set; }
        public string skypeuser { get; set; }
        public ApplicantImage photo { get; set; }
        public virtual ICollection<ApplicantPosition> applicantPosition { get; set; }
    
    }
    
    public class ApplicantPosition
    {
        public int ApplicantId { get; set; }
    
        public int PositionId { get; set; }
    
        public virtual Position Position { get; set; }
    
        public virtual Applicant Applicant { get; set; }
    
        public DateTime appliedDate { get; set; }
        public int StatusValue { get; set; }
    
        public Status Status
        {
            get { return (Status)StatusValue; }
            set { StatusValue = (int)value; }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a very small windows application consisting of just a single executable. As
Just tried to execute a small Lua script, but unfortunately I'm doing something wrong.
I am looking at doing a small web application for learning purposes, using .NET.
I am doing a very small online store application in PHP. So I have
I've developed a Ruby application (a small game), and I would like to 'distribute'
I'm just doing a simple graph using Open Flash Chart http://teethgrinder.co.uk/open-flash-chart/ which shows the
I'm sure I am just doing something really dumb and not seeing it but
I'm sure I'm just doing something stupid here, but I can't quite figure out
Doesn't seem to work for me, maybe I just doing it wrong
I've just started doing some PowerShell scripting, and I'm running into a problem testing

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.