struct Tinman.Core.Validating.ValidateResult

Holds the results of the validation of an object graph.

See also


Public / Constants


public static readonly attribute Success → (ValidateResult)

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

Public / Methods


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.


public method Log → (3)

logger in : ILogger

The logger to use for outputting the validation messages.

errors opt : bool = true

Output ValidateMessageType.Error messages?

warnings opt : bool = true

Output ValidateMessageType.Warning messages?

Logs all validation messages to the given logger in.


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.


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


public readonly attribute Errors → (IValidateMessage [ ])

The validation errors.

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


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


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?


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?


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


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