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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:23:47+00:00 2026-05-12T00:23:47+00:00

I am doing the below test to try and learn more about LINQ to

  • 0

I am doing the below test to try and learn more about LINQ to SQL.

I have got an Activities table which contains an activityId, parentId, type.

The type is used as a discriminator value, to say whether it is an activity, task or project.

I have an Activity, Task and Project class that inherit from Activity, it seems wrong for Task to inherit from Project semantically but to reduce redundant data it seemed a better way to do it, I may either change the name of that class or separate them.

Activity class does not have a parentId property but the Task class will use the parentId as a projectId to associate to the Project class.

I have attached a screenshot of the tables and my dbml as well as a class diagram, you can see from the class diagram it is only a simpler implementation I am not having sub-activities, tasks across diff projects, etc. I am also ignoring the user side of this sytem because it is only a prototype.. so ignore the manager class and I wont be using roles.. I am only using hardcoded test users.

I have a list of things I wanted to ask about.
1. My tasks all require a projectId since this is the parentID from the activity class.. how is this setup to work with the Project class? as you can see there is no association between them at the moment.. should I be creating a property for Project? how does that work when ActivityId is potentially also the projectID when it comes to the Project class?

  1. You can see an ActivityTime class that should only be for tracking time spent on a task, you can see this can be associated to the UserActivity table but I am wondering how this is done only for Tasks and not for all Activities?

  2. You can also see a project activity, sorry this class should also be inheriting from the Activity class I missed this when uploading the image. This is for such things as a milestone where an activity with no related time or user should still have a related project.

Anyone got any ideas on what I am trying to achieve? am I going too far with all of this? Thanks for any help 🙂 Sorry if there is not enough detail I was trying to keep it brief without going into a full list of the business requirements I had in mind for this test system.

EDIT: Just stating the obvious I’m sure but please copy the image location to take a better look.

alt text http://img134.imageshack.us/img134/1199/tmss.jpg

  • 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-12T00:23:48+00:00Added an answer on May 12, 2026 at 12:23 am

    I came up with a solution to this using the entity diagram for LINQ to SQL as shown above.

    Where I created a base activity abstract class that activity, task, project and project activity inherit from.

    Also the entity diagram seems to require you to add properties to inherited classes just to be able to use them for associations between classes. So in the end I did just that and made the original activityId from the base activity class a private property.

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

Sidebar

Related Questions

I have a method below doing casting on a String according to the given
I'm doing a bind to document like below, $(document).bind('click',doThis); But i have a text
The code below compiles/runs without errors. It created the db which has the table
I've written a simple test program to try to learn how to use template
I have an Oracle (10.2.0.4) database table with a column which is encrypted by
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I am learning C#. Doing the below exercises to make use of features. I
In C# 3.0, I'm doing the code below to declare a DateTime property and
What am i doing wrong in the below regular expression matching >>> import re
I'm doing a homework project that requires this: Below you will find the code

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.