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
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
propertyNamestringThe property name to validate.
Returns
- string
The validated property name.
Type Parameters
TThe type to validate against.
Exceptions
- InvalidPropertyForType
Thrown when the property does not exist on the type.