Class ValidationResult
Representation of validation results.
public class ValidationResult : DeputyBase
- Inheritance
-
ValidationResult
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
ValidationResults validationResults;
var validationResult = new ValidationResult("errorMessage", validationResults);
Remarks
Models a tree of validation errors so that we have as much information as possible about the failure that occurred.
ExampleMetadata: fixture=_generated
Constructors
ValidationResult(string?, ValidationResults?)
public ValidationResult(string? errorMessage = null, ValidationResults? results = null)
Parameters
errorMessage
stringresults
ValidationResults
Properties
ErrorMessage
public virtual string ErrorMessage { get; }
Property Value
IsSuccess
public virtual bool IsSuccess { get; }
Property Value
Results
public virtual ValidationResults Results { get; }
Property Value
Methods
AssertSuccess()
Turn a failed validation into an exception.
public virtual void AssertSuccess()
ErrorTree()
Return a string rendering of the tree of validation failures.
public virtual string ErrorTree()
Returns
Prefix(string)
Wrap this result with an error message, if it concerns an error.
public virtual ValidationResult Prefix(string message)
Parameters
message
string