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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:17:23+00:00 2026-05-23T17:17:23+00:00

I am using FluentValidation in my application to verify my entities, but I have

  • 0

I am using FluentValidation in my application to verify my entities, but I have come up with a little issue. My validation factory is setup to resolve validation classes from Windsor by attempting to resolve from the IValidator<EntityType> interface.

I want to make sure that whenever a validation class is creating that no one forgets to register it with Windsor.

Essentially I want to look at all classes in the assembly that implement the IValidator<EntityType> interface and call WindsorContainer.Resolve(typeof(IValidator<EntityType>)) to resolve that type, where EntityType can be any class in the assembly. So far, using reflection I have been able to pull out all classes that are derived from the generic interface IValidator<> but I can’t figure out how to proceed from there. The problem is I would have to find some way to pull out the actual entity used in the generic in order to call Windsor correctly, and I am at a loss of how to do that.

Is there an easier way to do this?

  • 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-23T17:17:24+00:00Added an answer on May 23, 2026 at 5:17 pm

    I want to make sure that whenever a validation class is creating that no one forgets to register it with Windsor.

    Why are you doing this? You should have an installer that automatically discovers these validation classes and registers them for you. Then you only need to test that you coded the installer correctly.

    The fact that someone adds a class that implements IValidator<TEntity> for some TEntity shouldn’t break your code!

    The problem is I would have to find some way to pull out the actual entity used in the generic in order to call Windsor correctly, and I am at a loss of how to do that.

    You want Type.GetGenericArguments.

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

Sidebar

Related Questions

Have an ASP.NET MVC3 app with model validation using FluentValidation . User enters some
I have an ASP.NET MVC3 website setup using fluent validation and ninject. The validation
Following the article http://www.thekip.nl/2011/09/22/using-fluentvalidation-for-both-domain-validation-and-validation-in-mvc-projects/ for me it's not still clear where does the validation
I'm using Fluent Validation with the Ninject.Web.Mvc.FluentValidation library to automatically wire up all of
I'm using FluentValidation form a form, and the Validation summary seems to be displayed
i have a generated domain model using LLBLGEN, and im validating those validation rules
I just implemented FluentValidation , everything seems awesome except one awkward little detail. @using
So I have my View Model validation down using Fluent Validation and my Service
I'm using FluentValidation to validate input on an MVC form. I have a checkbox.
I am using FluentValidation in my MVC project and have the following model and

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.