Class StandardValidator
- Namespace
- FoundationaLLM.Common.Validation
- Assembly
- FoundationaLLM.Common.dll
Provides the standard validation implementation.
public class StandardValidator
- Inheritance
-
StandardValidator
- Inherited Members
- Extension Methods
Constructors
StandardValidator(IResourceValidatorFactory, Func<string, Exception>)
Provides the standard validation implementation.
public StandardValidator(IResourceValidatorFactory validatorFactory, Func<string, Exception> exceptionBuilder)
Parameters
validatorFactory
IResourceValidatorFactoryThe resource validator factory used to create validators.
exceptionBuilder
Func<string, Exception>The function that builds the exception thrown when the object instance is not valid.
Methods
ValidateAndThrowAsync<T>(T)
Validates the specified object instance and throws an exception if the instance is invalid.
public Task ValidateAndThrowAsync<T>(T instance) where T : class
Parameters
instance
TThe object instance being validated.
Returns
Type Parameters
T
The type of the object instance to validate.