mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
20 lines
636 B
C#
20 lines
636 B
C#
using FluentValidation;
|
|
|
|
namespace Features.Auth.Queries.Login;
|
|
|
|
/// <summary>
|
|
/// Validates <see cref="LoginQuery" /> instances before they are processed.
|
|
/// </summary>
|
|
public class LoginValidator : AbstractValidator<LoginQuery>
|
|
{
|
|
/// <summary>
|
|
/// Configures validation rules requiring both <see cref="LoginQuery.Username" /> and
|
|
/// <see cref="LoginQuery.Password" /> to be non-empty.
|
|
/// </summary>
|
|
public LoginValidator()
|
|
{
|
|
RuleFor(x => x.Username).NotEmpty().WithMessage("Username is required");
|
|
|
|
RuleFor(x => x.Password).NotEmpty().WithMessage("Password is required");
|
|
}
|
|
} |