ValidateResult

Description

struct Tinman.Core.Validating.ValidateResult

Derived from

IEquatable<ValidateResult>

Holds the results of the validation of an object graph.

See also

Validator

Public / Constants

Success


public static readonly attribute Success → (ValidateResult)

A ValidateResult object that represents success, i.e. no errors or warnings.

Public / Methods

Add


[Pure]
public method Add → (1)

other in : ValidateResult

The validation result to add.

returns → ValidateResult

The combined validation result.

Adds the given validation result to this one.

Log


public method Log → (4)

logger in : ILogger

[not-null]
The logger to use for outputting the validation messages.

format opt : ValidateMessageFormat = ValidateMessageFormat.All

The validation message format to use.

minimum opt : ValidateMessageType = ValidateMessageType.Notice

The lowest validation message severity to output.

maximum opt : ValidateMessageType = ValidateMessageType.Critical

The highest validation message severity to output.

Logs all validation messages to the given logger in.

Throw


[Pure]
public method Throw → (2)

source in : string @ Tag

Error source tag.

message opt : string = null

Optional error message.

returns → ValidatingException

The ready-to-throw exception.

Returns a ValidatingException exception for this validation result, assuming it has failed.

To​String

3 overloads


public method ToString2 → (3)

format in : ValidateMessageFormat

The validation message format to use.

minimum opt : ValidateMessageType = ValidateMessageType.Notice

The lowest validation message severity to output.

maximum opt : ValidateMessageType = ValidateMessageType.Critical

The highest validation message severity to output.

returns → string

The string representation.

Returns the string representation of this validation result.


public method ToString3 → (4)

sb in : StringBuilder

[not-null]
The string representation output.

format opt : ValidateMessageFormat = ValidateMessageFormat.All

The validation message format to use.

minimum opt : ValidateMessageType = ValidateMessageType.Notice

The lowest validation message severity to output.

maximum opt : ValidateMessageType = ValidateMessageType.Critical

The highest validation message severity to output.

Returns the string representation of this validation result.

Public / Attributes

Errors


public readonly attribute Errors → (ValidateMessage [ ])

The validation errors (both critical and non-critical).

This array will either be non-empty (validation has failed) or null (validation has succeeded).

Has​Errors


public attribute HasErrors → (get)

value : bool

true if the validation has failed, false if not.

Has the validation failed (i.e. one or more errors have occurred)?

Has​Messages


public attribute HasMessages → (get)

value : bool

true if there is at least one error or warning, false if not.

Have there been any messages (errors / warnings) during validation?

Has​Notices


public attribute HasNotices → (get)

value : bool

true if there were one or more notice messages, false if not.

Have there been any notices during validation?

Has​Warnings


public attribute HasWarnings → (get)

value : bool

true if there were one or more warning messages, false if not.

Have there been any warnings during validation?

Messages


public readonly attribute Messages → (ValidateMessage [ ])

The validation messages (errors, warnings and notices) or null.

This array will either be non-empty (one or more errors, warnings or notices are present) or null (there are no messages).

Notices


public readonly attribute Notices → (ValidateMessage [ ])

The validation notices or null.

This array will either be non-empty (one or more notices are present) or null (there are no notices).

Warnings


public readonly attribute Warnings → (ValidateMessage [ ])

The validation warnings or null.

This array will either be non-empty (one or more warnings are present) or null (there are no warnings).