mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 09:37:23 +00:00
21 lines
637 B
C#
21 lines
637 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");
|
|
}
|
|
}
|