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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:57:56+00:00 2026-05-12T16:57:56+00:00

First of all I am making it clear that, I am not using any

  • 0

First of all I am making it clear that, I am not using any OR Mapper framework to solve this problem, coz I need to understand the model from the ground up.

OK. Let’s see the table designs:

Course – table

------------------
 ID | CourseName
------------------
 1  |  C++
 2  |  Java
------------------

Teacher – table

-----------------------
 ID |   TeacherName
-----------------------
 1  |   Professor X
 2  |   Professor Y  
-----------------------

CourseTeacher – table

---------------------------------------------
 ID | CourseID | TeacherID | ClassTime
---------------------------------------------
 1  |   1      |     1     | Monday    10:55
 2  |   1      |     2     | Thursday  10:55
 3  |   2      |     1     | Tuesday   11:45
 4  |   2      |     2     | Wednesday 11:45
---------------------------------------------

How should I design my classes in C#?

There can be another problem like is:

User – table

------------------
 ID | UserName
------------------
 1  |  a
 2  |  b
------------------

Role – table

-----------------------
 ID |   RoleName
-----------------------
 1  |   c
 2  |   d
-----------------------

UserRole – table

---------------------------------------------
 ID | UserID | RoleID | Remarks
---------------------------------------------
 1  |   1      |     1     | xy
 2  |   1      |     2     | yz
 3  |   2      |     1     | zx
 4  |   2      |     2     | xx
---------------------------------------------
  • 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-12T16:57:57+00:00Added an answer on May 12, 2026 at 4:57 pm

    In general, when you have a many-to-many relationship in your domain model, the access patterns in your code will either be from one side of the M2M or from the other…

    For e.g. If you have a structure containing people, each of whom has made a number of purchases at your retail outlets, you might as a rule want to access those transactions thrpugh a person, not through the product. in other words, you might more often want to know what products a specific person purchased, not what people purchased a specific product. So in this example you would simply have each person class contain a property which is a collection of products. There would be no need to access the person class through the Product class.

    Another e.g. If you have a a structure containing people, each of whom subscribes to a number of magazines.

    Now if you are the publisher, you might as a rule want to access those transactions through the magazine, not through the person. in other words, you would much more often want to know what people subscribe to a specific magazine, not what magazines a specific person subscribes to. So in this example you would put a Subscribers collection property in the Magazine class.

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

Sidebar

Related Questions

First of all, let me say that I am not a professional coder -
note: First of all i am using visual studio 2010. Usually i need dll
First let me explain why I am asking this question so its clear that
First of all, this isn't for a keylogger, it's for an input in a
First of all there is probably a question like this already but i couldn't
First of all, apologize because I have seen some posts about this, but I
First of all, I want to make something clear before I get yelled at:
First, I know this question has been asked several times before and that in
First, let me point out that I read all the posts regarding database versioning,
First a few definitions to keep things clear. User: A live person, using the

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.