mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
update backend/shared docs
This commit is contained in:
@@ -5,9 +5,8 @@ using MediatR;
|
|||||||
namespace Shared.Application.Behaviors;
|
namespace Shared.Application.Behaviors;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MediatR pipeline behavior that runs all registered FluentValidation validators for a
|
/// MediatR pipeline behavior that runs registered FluentValidation validators before the handler,
|
||||||
/// request before invoking its handler, short-circuiting with a <see cref="ValidationException" />
|
/// throwing <see cref="ValidationException" /> if any report failures.
|
||||||
/// when any validator reports failures.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ValidationBehavior<TRequest, TResponse>(IEnumerable<IValidator<TRequest>> validators)
|
public class ValidationBehavior<TRequest, TResponse>(IEnumerable<IValidator<TRequest>> validators)
|
||||||
: IPipelineBehavior<TRequest, TResponse>
|
: IPipelineBehavior<TRequest, TResponse>
|
||||||
|
|||||||
@@ -1,29 +1,19 @@
|
|||||||
namespace Shared.Contracts;
|
namespace Shared.Contracts;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generic envelope used to wrap API responses that carry a data payload alongside a human-readable message.
|
/// Generic envelope used to wrap API responses that carry a data payload alongside a message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">The type of the data payload returned in the response.</typeparam>
|
|
||||||
public record ResponseBody<T>
|
public record ResponseBody<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// A human-readable message describing the outcome of the request.
|
|
||||||
/// </summary>
|
|
||||||
public required string Message { get; init; }
|
public required string Message { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The data payload associated with the response.
|
|
||||||
/// </summary>
|
|
||||||
public required T Payload { get; init; }
|
public required T Payload { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Envelope used to wrap API responses that carry only a human-readable message and no data payload.
|
/// Envelope used to wrap API responses that carry only a message and no data payload.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ResponseBody
|
public record ResponseBody
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// A human-readable message describing the outcome of the request.
|
|
||||||
/// </summary>
|
|
||||||
public required string Message { get; init; }
|
public required string Message { get; init; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user