Table of Contents

Class PropertyValidator

Namespace
Cratis.Chronicle.Projections.ModelBound
Assembly
Cratis.Chronicle.dll

Provides validation for property names against types.

public static class PropertyValidator
Inheritance
PropertyValidator
Inherited Members

Methods

ValidatePropertyExists(Type, string)

Validates that a property name exists on a given type.

public static string ValidatePropertyExists(Type type, string propertyName)

Parameters

type Type

The type to validate against.

propertyName string

The property name to validate.

Returns

string

The validated property name.

Exceptions

InvalidPropertyForType

Thrown when the property does not exist on the type.

ValidatePropertyExists<T>(string)

Validates that a property name exists on a given type.

public static string ValidatePropertyExists<T>(string propertyName)

Parameters

propertyName string

The property name to validate.

Returns

string

The validated property name.

Type Parameters

T

The type to validate against.

Exceptions

InvalidPropertyForType

Thrown when the property does not exist on the type.