SchemaValidator Class

Definition

This abstract class allows any available library to be used to generate schemas from .NET types and validate objects against schemas.

public abstract class SchemaValidator
type SchemaValidator = class
Public MustInherit Class SchemaValidator
Inheritance
SchemaValidator

Remarks

Defining both GenerateSchema(Type) and TryValidate(Object, Type, String, IEnumerable<Exception>) is required. If you do not wish to validate, then evaluate all schemas as valid.

Constructors

SchemaValidator()

Methods

GenerateSchema(Type)

Generates a schema from dataType and returns it as a string.

TryValidate(Object, Type, String, IEnumerable<Exception>)

Validates that data is valid according to schemaDefinition.

Validate(Object, Type, String)

Validates that data is valid according to schemaDefinition. If the object is not valid, this method throws an AggregateException containing all of the validation errors.

Applies to