feat: create request projects for basic CQRS
This commit is contained in:
commit
d614788e06
190 changed files with 12236 additions and 0 deletions
32
src/request.validation/Validation.cs
Normal file
32
src/request.validation/Validation.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
namespace Geekeey.Request.Validation;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the result of executing one or more validations against a given object or request.
|
||||
/// </summary>
|
||||
public sealed class Validation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of executing one or more validations against a given object or request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class contains the list of validation problems identified during the validation process.
|
||||
/// A validation is considered successful if no problems are found.
|
||||
/// </remarks>
|
||||
public Validation(IEnumerable<Problem> problems)
|
||||
{
|
||||
Problems = [.. problems];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the validation was successful.
|
||||
/// </summary>
|
||||
public bool IsValid => Problems.Count is 0;
|
||||
|
||||
/// <summary>
|
||||
/// The problems that were found during validation.
|
||||
/// </summary>
|
||||
public IReadOnlyList<Problem> Problems { get; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue