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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:43:49+00:00 2026-05-30T07:43:49+00:00

I am trying to refactor a solution to bring on board another project. I

  • 0

I am trying to refactor a solution to bring on board another project.
I have a Core project where common classes across projects reside.

I’ve tried to simpify my question by using 2 imaginary projects: Holidays and Weather…

I have a file load process setup for the Holidays project which has the following 2 classes:

public class Job
{
    public virtual string CreatedBy { get; set; }
    public virtual DateTime? CreatedDate { get; set; }
    public virtual Security Security { get; set; }

    protected IList<File> _files = new List<File>();
    public virtual IEnumerable<File> Files
    {
        get { return _files; }
    }
}

public class File
{
    public virtual string FileName { get; set; }
    public virtual FileType FileType { get; set; }
    public virtual FileStatusType FileStatusType { get; set; }
    public virtual Job Job { get; set; }
}

The file load process for the Weather project has exactly the same structure as Holidays, except that the Jobs class does not have a Security property.

My question is, is it possible to somehow move both classes into the Core project to allow both projects to use them?
Obviously Weather does not need the Security property, so I was thinking I would have a Core.Job class without Security, and then extend the Core.Job in Holidays.Job.

But once I do that, in the Core.File class, what Job is it referring to? As it sits in the Core project it must be the Core.Job.
So would I then need to have Job and File sit in Holidays, and Weather (and any other future projects) use the Core.Job and Core.File?

I don’t want the Core project to have any references to sub projects.

I am using NHibernate, and so have mapping files – adding to the complexity.

Hope this is clear enough

Thanks

  • 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-30T07:43:51+00:00Added an answer on May 30, 2026 at 7:43 am

    Not very clear why confuse on the soluton offered by you (assuming that I right understood you)

    //Core DLL 
    
    public class Job
    {
        public virtual string CreatedBy { get; set; }
        public virtual DateTime? CreatedDate { get; set; }  
        protected IList<File> _files = new List<File>();
        public virtual IEnumerable<File> Files
        {
            get { return _files; }
        }
    }
    

    in the Hollidays you have

    public class HollidayJob : Job
    {
        public virtual Security Security { get; set; }
    }
    

    in Weather simply use a type Job, if it selfsufficient.

    In this case you refer CoreDLL from Holliday project and Weather. When you serialize it via NHibernate it for HollidayJob save one field more, but when Weather reads the same table it skips that field, as don’t know anything, and don’t actually care abotu it.

    Hope this helps.

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

Sidebar

Related Questions

I am trying to refactor a class that I have into 2 classes. Unfortunately
I am trying to refactor a solution that includes 2 MVC projects: a User-Experience
I'm trying to refactor a large, old project and one thing I've noticed is
I have the following code for adding to/extracting from Zip. I'm trying to refactor
I'm trying to refactor an old web service project using new structure (with Maven)
I am trying to refactor old PHP project, and this project does not access
I'm trying to refactor this code. I have this jquery ajax call $.ajax({ url:
Members at work have come across a C# project posted on Google code that
So I have this one CakePHP web application that I'm trying to refactor. There
I am trying to refactor out my application a little bit to keep it

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.