WorldWideScripts.net Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
.NET / Miscellaneous

AspectV - .NET Data Validation

— Add-On to WorldWideScripts.net

Subscribe to our feed to stay up to date!

New! Follow us as you want it!


AspectV - .NET Data Validation - WorldWideScripts.net Item for Sale

Ads

Ad: Bluehost hosting

This component builds on top of the regular .NET validation framework and addresses concerns that are not normally at the forefront of the average developer – stability and security.

Standard User Valid Data Corrupt Data Enter no. days 1010612020 Automated User Select Target Save Malicious User Successful Validation Possibly Compromised

  1. Security beyond UI validation. Ensuring that comprehensive model validation can be performed on all layers within your application. The business layer, domain model and even service layers are ideal places for validation with calls coming from many different clients.
  2. Deep object graph validation is another major highlight for this component. Instead of simple validating only the immediate properties of the object under inspection, this component will validate to depth (n) or the entire object graph. This ensures that not only your top level object is valid, but the entire object graph is valid according to the decorated requirements of theValidation Attributes.
  3. Validate using any attribute that inherits ValidationAttribute therefore your custom validation attributes will always work.

Benefits of the Data Annotations Validator

  • Validation in all your .NET application including WebForms, MVC, WCF, etc
  • Validate objects in your business layer
  • Ease application maintenance and create predicatable results
  • Future proof quality checking in your application allowing for newer attributes to automatically take effect
  • Ensures that your application is being built correctly (guiding light)
  • Stop the problems before they start, always ensuring that the your data is valid

What do you get when you buy?

  • NET Assembly with Strong Name Signature
  • Debug file (PDB)
  • XML comments (Intellisense)
  • Console application Demo Project
  • A comprehensive help file documenting full usage
  • API Documentation
  • C# Source Code
  • Visual Studio 2012 Solution
  • Support

Technologies

This component is built using the .NET 3.5 Framework which means in can be used in all .NET applications that are using the 3.5 framework or newer. This includes .NET 3.5, 4.0, & 4.5+.

You can immediately use this within your application and is very simple. Ask any questions or suggest features atsupport.avantprime.com!

How would I use this component?

Example of how to use theValidator, decorating your properties with validation attributes to ensure that they meet your requirements and then enforcing these rules by calling the Validate operation.

using System;
using System.ComponentModel.DataAnnotations;

namespace Demo.TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var application = new Application
                {
                Applicant = new Person
                {
                    Email = "[email protected]",
                    FirstName = "John (Use a lot of words to cause validation failure)",
                    LastName = null
                },
                Address = new Address
                {
                    StreetName = "123 CodeVille Terrace",
                    City = "Sea Sharp" 
                },
                PaymentDetails = new Payment
                {
                    CreditCardNumber = "4111111111111110" 
                }
            };

            Console.WriteLine(AvantPrime.AspectV.Validator.Validate(application)
                                  ? "Awesome! Validation Success." 
                                  : "Something awful has happened. Validation Failed.");

            Console.WriteLine();
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }

    public class Application
    {
        [Required]
        public Person Applicant { get; set; }

        [Required]
        public Address Address { get; set; }

        public Payment PaymentDetails { get; set; }
    }

    public class Person
    {
        [EmailAddress]
        [Required]
        public string Email { get; set; }

        [StringLength(15)]
        public string FirstName { get; set; }

        [StringLength(15)]
        public string LastName { get; set; }
    }

    public class Address
    {
        [Required]
        public string StreetName { get; set; }

        public string Locality { get; set; }
        public string City { get; set; }
        public string County { get; set; }

        [Required]
        public string PostCode { get; set; }

        [Required]
        public string Country { get; set; }
    }

    public class Payment
    {
        [CreditCard]
        public string CreditCardNumber { get; set; }
    }
}

Download
Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers

Properties

Created:
20 March 13

Last Update:
13 June 13

Compatible Browsers:
IE6, IE7, IE8, IE9, IE10, Firefox, Safari, Opera, Chrome

Software Version:
.NET 3.5, .NET 3.7, .NET 4.0, .NET 4.5

Files Included:
C# CS

Keywords

ASP NET Validation, ComponentModel.DataAnnotations, Custom Validation, Custom Validator, Data Annotations, Deep Validation, MVC Validation, Model Validation, NET Validation, Object Validation, Shallow Validation, ValidateAttribute, data validation, validation, validato