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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:54:41+00:00 2026-05-17T14:54:41+00:00

Here is my situation. My solution structure is as follows. Project Used to handle

  • 0

Here is my situation. My solution structure is as follows.

Project Used to handle routes, displaying data, …

Project.Core Used to handle business logic, validation, querying, …

In Project.Core I have a validation class that validates my DTO (Data Transfer Object).

My validation class (in Project.Core):

public class IncidentValidator<T> : IValidator<T>
    where T : AuditReport
{
    public IncidentValidator(IList<T> ar)
    {
        AR = ar;
    }

    public IList<T> AR { get; set; }

    public IList<Model> Validate()
    {
        var list = new List<Model>();
        foreach (T ar in AR)
        {
            list.Add(new Model
                         {
                             IncidentId = new KeyValuePair<int, RuleType>(
                                 ar.IncidentId,
                                 new OccurrenceCountRule(ar).RulesValidate()
                                 ),
                             Circuit = new KeyValuePair<string, RuleType>(
                                 ar.Circuit,
                                 new CircuitRule(ar).RulesValidate()
                                 )
                         });
        }

        return list;
    }
}

My view model (in Project):

public class Model
{
    public KeyValuePair<int, RuleType> IncidentId { get; set; }
    public KeyValuePair<string, RuleType> Circuit { get; set; }
}

So my question is, should Project.Core reference Project to have access to my view models so my validation class can populate it? I don’t really like that approach however. I’ve thought about doing the validation inside my controller but don’t like that idea either. Perhaps my view model can live inside Project.Core or is that considered bad design?

What can I do?

  • 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-17T14:54:42+00:00Added an answer on May 17, 2026 at 2:54 pm

    If this validator class is intended to validate view models, then you should put it in the same project as the one containing your view models. Another possibility is to externalize your view models into a separate assembly which you reference in Project.Core (the first approach seems better though). You shouldn’t reference Project in Project.Core in any case.

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

Sidebar

Related Questions

Having trouble finding a solution for my situation here. Sorry if this has been
Here is the situation: I have inherited two separate machines, one used for development
Let's suppose I have the following structure in my project (I'm using iBatis as
Here’s the situation: We have a 3rd party application that intermittently displays an error
Here's my situation : in the webapp, I use an interceptor to set the
Here is the situation : Our Dev Team has heterogeneous OS systems, scattered between
Here's the situation I'm dealing with. The original query I had was: SELECT c.CustID,
I have a master project that's using a fairly standard source tree approach +
This query appears in mysql slow query log: it takes 11 seconds. INSERT INTO

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.