21 lines
568 B
C#
21 lines
568 B
C#
using FastEndpoints;
|
|
using FluentValidation;
|
|
using Knots.DTO.Group;
|
|
|
|
namespace Knots.Validators.Group;
|
|
|
|
public class UpdateGroupMembersAmountDtoValidator : Validator<UpdateGroupMembersAmountDto>
|
|
{
|
|
public UpdateGroupMembersAmountDtoValidator()
|
|
{
|
|
RuleFor(x => x.Id)
|
|
.NotEmpty()
|
|
.WithMessage("L'id est requis")
|
|
.GreaterThan(0)
|
|
.WithMessage("L'id doit être supérieur à 0");
|
|
|
|
RuleFor(x => x.MembersAmount)
|
|
.NotEmpty()
|
|
.WithMessage("Le nombre de membres est requis");
|
|
}
|
|
} |