Verifying the component--fluentvalidation

Source: Internet
Author: User

Fluentvalidation

Fluentvalidation is a data validation component that differs from the ASP. NET dataannotataion Attribute validation entity, providing a way to validate the separation of entities from validation, while Fluentvalidation also provides expressions Chained syntax.

Address:

Https://github.com/JeremySkinner/FluentValidation

     Static voidMain (string[] args) {            //non-null validationTestvalidator Validator =NewTestvalidator (v = v.rulefor (x =x.surname).            Notnull ()); varResult= Validator. Validate (Newperson {Surname ="Foo"});//trueConsole.WriteLine (Result.            IsValid); Result= Validator. Validate (Newperson {Surname =NULL});//falseConsole.WriteLine (Result.            IsValid); Validator=NewTestvalidator {v= v.rulefor (x =x.surname).             Notempty ()}; Result= Validator. Validate (Newperson {Surname =NULL }); Console.WriteLine (Result.        IsValid); }
 public  class   person { public  string   NameField;  public  int  Id {get ; set          public  string  Surname {get ; set          public  string  forename {get ; set     

Source code has many test examples

Verifying the component--fluentvalidation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.