Wisdom.net Framework Design (vii) Validation framework

Source: Internet
Author: User

wisdom.net-Validation Framework

1. Classification Here we divide data validation into the following types of

    • Data type validation is primarily used to ensure that data type input is correct such as age an entry a-year-old, apparently illegal
    • The domain check is primarily used to verify that the input data is in a range of values such as entering 400 in age one, which is obviously illegal.
    • The format check is primarily used to check that the data is in the correct format, such as an email input CA, which is obviously illegal.
    • Custom check, custom checksum data. such as verifying that the data format is legitimate, etc.

2. Introduction

Built as a standard, based on the attribute of the class's attributes (this only implements the length verification, the others are yet to be expanded)

3. Calling methods

    Public class Demo    {       [MaxLength (5)]       publicstringgetset ; }    }

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.