Show / Hide Table of Contents

Class ValidationResult

The validation result, consisting of a list of validation messages and flags indicating the validation state.

Inheritance
object
ValidationResult
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Codecrete.SwissQRBill.Generator
Assembly: Codecrete.SwissQRBill.Core.dll
Syntax
public sealed class ValidationResult

Properties

| Edit this page View Source

CleanedBill

Gets or sets the cleaned bill data.

As part of the validation, the bill data is cleaned, i.e. leading and trailing whitespace is trimmed, empty values are replaced with null, invalid characters are replaced and too long data is truncated. The result is the cleaned bill data.

Declaration
public Bill CleanedBill { get; set; }
Property Value
Type Description
Bill

The cleaned bill data.

| Edit this page View Source

Description

Gets a human-readable description of the validation problems.

The description includes errors only.

Declaration
public string Description { get; }
Property Value
Type Description
string

The description.

| Edit this page View Source

HasErrors

Gets if this validation result contains any error messages.

Declaration
public bool HasErrors { get; }
Property Value
Type Description
bool

true if the result contains any error messages, false otherwise.

| Edit this page View Source

HasMessages

Gets if this validation result contains any messages.

Declaration
public bool HasMessages { get; }
Property Value
Type Description
bool

true if the result contains any messages, false otherwise.

| Edit this page View Source

HasWarnings

Gets if this validation result contains any warning messages.

Declaration
public bool HasWarnings { get; }
Property Value
Type Description
bool

true if the result contains any warning messages, false otherwise.

| Edit this page View Source

IsValid

Gets if the bill data is valid and the validation therefore has succeeded.

A successful validation may still produce warning messages.

Declaration
public bool IsValid { get; }
Property Value
Type Description
bool

true if the validation has succeeded, false otherwise.

| Edit this page View Source

ValidationMessages

Gets the list of validation messages.

The result is never null.

Declaration
public List<ValidationMessage> ValidationMessages { get; }
Property Value
Type Description
List<ValidationMessage>

The validation message list.

Methods

| Edit this page View Source

AddMessage(MessageType, string, string, string[])

Adds a new validation message to this validation result.

Declaration
public void AddMessage(ValidationMessage.MessageType type, string field, string messageKey, string[] messageParameters = null)
Parameters
Type Name Description
ValidationMessage.MessageType type

The message type.

string field

The name of the affected field.

string messageKey

The language-neutral message key.

string[] messageParameters

The optional message parameters (text) to be inserted into the localized message.

See Also
ValidationMessage
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX