Add ReadProfileViewQueryValidator for Id validation

Introduced ReadProfileViewQueryValidator using FluentValidation to ensure the Id property, if provided, is greater than 0. Includes a custom error message for invalid Id values.
This commit is contained in:
2026-04-16 14:39:26 +02:00
parent 0d9489203f
commit 68b3eb53c0

View File

@@ -0,0 +1,15 @@
using FluentValidation;
using ReC.Application.Profile.Queries;
namespace ReC.Application.Common.Validations;
public class ReadProfileViewQueryValidator : AbstractValidator<ReadProfileViewQuery>
{
public ReadProfileViewQueryValidator()
{
RuleFor(x => x.Id)
.GreaterThan(0)
.When(x => x.Id.HasValue)
.WithMessage("Id must be greater than 0.");
}
}