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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:35:38+00:00 2026-05-16T14:35:38+00:00

I am looking for examples of configuration based validation using Validation Application Block. I’ve

  • 0

I am looking for examples of configuration based validation using Validation Application Block. I’ve found this

I want to ask if someone has an alternative solution to using EL VAB 5.0 to achieve configuration based validation. I’ve started with DataAnnotations but soon found out that some properties will need different types of validation depending on who is using the application.

Also if anyone has more examples for configuration with VAB and any advice as to what I might run into, please share.

  • 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-16T14:35:39+00:00Added an answer on May 16, 2026 at 2:35 pm

    There are several paths you can walk to achieve this. First of all you can (ab)use rulesets for this. You can create a ‘base’ ruleset with rules that hold for everybody and you can make a ruleset per role in the system and perhaps even a ruleset per user, but of course that would be cumbersome.

    Another option would be to create an IConfigurationSource implementation that is able to return a ValidationSettings instance, based on the logged in user. Now there are several ways that you can build a ValidationSettings object. Here are a few examples:

    1. You can load multiple configuration files from disk using the FileConfigurationSource based on the role. Something like: return (new FileConfigurationSource('validation_' + role + '.config')).GetSection(sectionName);
    2. You can build up the ValidationSettings instances dynamically (and cache them). You can store this definition in the database and load them (this would be a lot of work) or define them in code (perhaps separated by assembly). Here is an example of a code based configuration.

    Also to prevent having to duplicate parts of your configuration, you can do the following:

    1. Merge multiple configurations together. You can for instance merge the base line validation with the role specific validation. This saves you from having to manually validate according to the base line and do a second validation for the role specific validation. While this is not supported out of the box, I wrote about how to do this on my blog here.
    2. You can merge rules based on type inheritance. While VAB only supports validator inheritance for attribute based validation out of the box, I’ve wrote about this on my blog, here.

    I hope this helps.

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

Sidebar

Related Questions

I'm looking for examples where a human-based service replaced an automated one. For example,
Looking at the Slickgrid examples and using Google Chrome, I'm setting a breakpoint on
I'm using StructureMap at the moment, generally with convention-based ( Scan() ) auto-configuration, and
Looking at examples and tutorials for some MVC libraries for web development on the
Looking at examples about socket programming, we can see that some people use AF_INET
I've been looking at examples of REST API's like Netflix http://developer.netflix.com/docs/REST_API_Reference#0_59705 and Twitter and
I have been looking at examples online, and tutorials, and I cannot find anything
I am looking at the examples given at the XML_Serialize pear plugin manual. I
I am looking for some examples on storing some data into Google cloud storage
I was looking at the Pro Core Data examples and I was wondering what

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.