-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from deveel/release/0.2.0
Release Candidate 0.2.0
- Loading branch information
Showing
8 changed files
with
275 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Deveel | ||
{ | ||
/// <summary> | ||
/// Represents an error that occurred while validating a | ||
/// a command or operation. | ||
/// </summary> | ||
public interface IValidationError : IOperationError | ||
{ | ||
/// <summary> | ||
/// Gets the list of validation results that caused the error. | ||
/// </summary> | ||
IReadOnlyList<ValidationResult> ValidationResults { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Deveel | ||
{ | ||
/// <summary> | ||
/// An error that occurred during the validation of an operation. | ||
/// </summary> | ||
public readonly struct OperationValidationError : IValidationError | ||
{ | ||
/// <summary> | ||
/// Constructs an instance of an <see cref="OperationValidationError"/> object. | ||
/// </summary> | ||
/// <param name="code"> | ||
/// The code of the error, that is unique within the | ||
/// given domain. | ||
/// </param> | ||
/// <param name="domain"> | ||
/// The domain where the error occurred. | ||
/// </param> | ||
/// <param name="validationResults"> | ||
/// A list of validation results that caused the error. | ||
/// </param> | ||
public OperationValidationError(string code, string domain, IReadOnlyList<ValidationResult> validationResults) | ||
{ | ||
ArgumentNullException.ThrowIfNull(code, nameof(code)); | ||
ArgumentNullException.ThrowIfNull(domain, nameof(domain)); | ||
ArgumentNullException.ThrowIfNull(validationResults, nameof(validationResults)); | ||
|
||
Code = code; | ||
Domain = domain; | ||
ValidationResults = validationResults; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public IReadOnlyList<ValidationResult> ValidationResults { get; } | ||
|
||
/// <inheritdoc/> | ||
public string Code { get; } | ||
|
||
/// <inheritdoc/> | ||
public string Domain { get; } | ||
|
||
[ExcludeFromCodeCoverage] | ||
string? IOperationError.Message => null; | ||
|
||
[ExcludeFromCodeCoverage] | ||
IOperationError? IOperationError.InnerError => null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters