ValidateResult

Description

struct Tinman.Core.Validating.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

Throw


[Pure]
public method Throw → (2)

source in : string

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.

ToString


public override method ToString → ()

returns → string

The string representation.

Returns the string representation of this value.

Messages are output in two blocks, first all warnings (see Warnings), then all errors (see Errors). Each message is output using IValidateMessage.ToString, where the previous warning or error of the respective block is passed in.

Public / Attributes

Errors


public readonly attribute Errors → (IValidateMessage [ ])

The validation errors.

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

HasErrors


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)?

HasMessages


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?

HasWarnings


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 → (IValidateMessage [ ])

The validation messages (errors and warnings) or null.

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

Warnings


public readonly attribute Warnings → (IValidateMessage [ ])

The validation warnings or null.

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