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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:02:10+00:00 2026-05-26T03:02:10+00:00

In a c#.net application I have a two classes as below Employee EmployeeId :

  • 0

In a c#.net application I have a two classes as below

Employee

EmployeeId : int : Primary key

Name : string

Job

JobId : int : Primary key

Name : string

EmployeeId : int

In database (SQL Server) I have two tables to save data from those classes (Employee & Job)
(ID fields are auto increment fields so can have same no in both tables)

Now I need to implement a new feature to give users to add comments for Employees or for Jobs, So I need to create a single Comment class to share by both classes.

What is the best Class & Table Structure to implement this new feature.

  • 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-26T03:02:10+00:00Added an answer on May 26, 2026 at 3:02 am

    I’d recommend a database design like which allows adding more comment types in the future without the need to modify your database.

    Table Comment

    Id (int, Primary Key)
    CommenteeId (int, not null)
    CommentTypeId (int, not null)
    Text (nvarchar(255))
    

    Table CommentType

    Id (int, Primary Key)
    Name (nvarchar(50), not null)
    

    CommenteeId will reference Job or Employee or any other table you’d need to comment in the future.

    CommentTypeId will reference CommentType where you can add types as needed.


    As for your class design it could look like this:

    public class Job
    {
        public List<Comment> Comments;
        public string Name { get; set; }
    }
    
    
    public class Employee
    {
        public List<Comment> Comments;
        public string Name { get; set; }
    }
    

    … as a basic idea. How and when your Comment is loaded as part of Employee or Job is depending on your method of accessing your database.

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

Sidebar

Related Questions

Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have
Suppose you have two seperate ASP.NET Web Application projects that both need to use
i have two .net web application and they ara running on different domain same
I have application in VB.net that have two different form (Form1 and Form2). Now
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application
I have two workflow foundation (.NET 3.5 SP 1) application which compiles fine. It
I have to deploy my ASP.NET application into two seperated IIS servers. My application
I have a ADO.NET/TSQL performance question. We have two options in our application: 1)
I have one asp.net web application. It is using two membership provider. Two sign-in
I have two colors in my .NET application that are user defined. I'd like

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.