Class DataValidationResult
Encapsulates the result of a data validation.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Data.Validation
Assembly: Kephas.Data.dll
Syntax
public class DataValidationResult : IDataValidationResult, IEnumerable<IDataValidationResultItem>, IEnumerable
Constructors
| Improve this Doc View SourceDataValidationResult()
Initializes a new instance of the DataValidationResult class.
Declaration
public DataValidationResult()
DataValidationResult(IDataValidationResultItem[])
Initializes a new instance of the DataValidationResult class by adding the items to the result.
Declaration
public DataValidationResult(params IDataValidationResultItem[] items)
Parameters
Type | Name | Description |
---|---|---|
IDataValidationResultItem[] | items | The items to add. |
DataValidationResult(Exception, String, DataValidationSeverity)
Initializes a new instance of the DataValidationResult class by adding a new item with the provided parameters.
Declaration
public DataValidationResult(Exception exception, string memberName = null, DataValidationSeverity severity = DataValidationSeverity.Error)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | The exception. |
System.String | memberName | The name of the member. |
DataValidationSeverity | severity | The severity. |
DataValidationResult(String, String, DataValidationSeverity)
Initializes a new instance of the DataValidationResult class by adding a new item with the provided parameters.
Declaration
public DataValidationResult(string message, string memberName = null, DataValidationSeverity severity = DataValidationSeverity.Error)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message. |
System.String | memberName | The name of the member. |
DataValidationSeverity | severity | The severity. |
Fields
| Improve this Doc View SourceSuccess
The validation result indicating that the validation succeeded without any issues.
Declaration
public static readonly DataValidationResult Success
Field Value
Type | Description |
---|---|
DataValidationResult |
Methods
| Improve this Doc View SourceAdd(IDataValidationResultItem[])
Adds the items to the validation result.
Declaration
public DataValidationResult Add(params IDataValidationResultItem[] items)
Parameters
Type | Name | Description |
---|---|---|
IDataValidationResultItem[] | items | The items to add. |
Returns
Type | Description |
---|---|
DataValidationResult | This DataValidationResult. |
Add(String, String, DataValidationSeverity)
Adds a result item to the validation result.
Declaration
public DataValidationResult Add(string message, string memberName = null, DataValidationSeverity severity = DataValidationSeverity.Error)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message. |
System.String | memberName | Name of the member (optional). |
DataValidationSeverity | severity | The severity (optional). Default value is Error |
Returns
Type | Description |
---|---|
DataValidationResult | This DataValidationResult. |
GetEnumerator()
Gets the enumerator.
Declaration
public IEnumerator<IDataValidationResultItem> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<IDataValidationResultItem> | The enumerator. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Gets the enumerator.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator. |