Table of Contents

Class ModelValidationHelper

Namespace
Acuit.Pinpoint.Common
Assembly
Acuit.Pinpoint.Common.dll

Helper methods for validation.

public static class ModelValidationHelper
Inheritance
ModelValidationHelper
Inherited Members

Methods

ValidateProperty(object, string)

Validates a property using data annotation validation attributes.

public static string ValidateProperty(object entity, string propertyName)

Parameters

entity object

The entity containing the property to validate.

propertyName string

The name of the property to validate.

Returns

string

A string containing all errors from failed validations, separated by new lines.

Examples

string IDataErrorInfo.Error
{
    get { return null; }
}

string IDataErrorInfo.this[string columnName]
{
    get { return ValidationHelpers.ValidateProperty(this, columnName); }
}

Remarks

This can be used to implement IDataErrorInfo.