Class ValidationMiddlewareOptions
- Namespace
- WorkflowForge.Extensions.Validation.Options
- Assembly
- WorkflowForge.Extensions.Validation.dll
Configuration options for Validation middleware. Controls validation behavior and error handling. Inherits common options functionality from WorkflowForgeOptionsBase.
public sealed class ValidationMiddlewareOptions : WorkflowForgeOptionsBase, ICloneable
- Inheritance
-
ValidationMiddlewareOptions
- Implements
- Inherited Members
Constructors
ValidationMiddlewareOptions()
Initializes a new instance with default section name.
public ValidationMiddlewareOptions()
ValidationMiddlewareOptions(string)
Initializes a new instance with custom section name.
public ValidationMiddlewareOptions(string sectionName)
Parameters
sectionNamestringCustom configuration section name.
Fields
DefaultSectionName
Default configuration section name for binding from appsettings.json.
public const string DefaultSectionName = "WorkflowForge:Extensions:Validation"
Field Value
Properties
IgnoreValidationFailures
Gets or sets whether to ignore validation failures. When true, validation errors are logged but don't stop workflow execution. When false, validation failures throw WorkflowValidationException. Default is false (strict validation).
public bool IgnoreValidationFailures { get; set; }
Property Value
LogValidationErrors
Gets or sets whether to log validation errors. When true, validation errors are logged even if ignored. When false, validation errors are not logged (not recommended). Default is true.
public bool LogValidationErrors { get; set; }
Property Value
StoreValidationResults
Gets or sets whether to include validation details in foundry properties. When true, stores validation results in foundry.Properties["Validation.Status"] and ["Validation.Errors"]. When false, validation results are only logged or thrown. Default is true.
public bool StoreValidationResults { get; set; }
Property Value
ThrowOnValidationError
Gets or sets whether to throw exceptions on validation errors. When true, throws WorkflowValidationException on validation failure. When false, logs error and continues (requires IgnoreValidationFailures = true). Default is true.
public bool ThrowOnValidationError { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this options instance.
public override object Clone()
Returns
- object
A new instance with the same configuration values.
Validate()
Validates the configuration settings and returns any validation errors.
public override IList<string> Validate()