18 lines
523 B
C#
18 lines
523 B
C#
using FluentValidation;
|
|
using ldap_cesi.DTOs.Inputs.Service;
|
|
|
|
namespace ldap_cesi.Validator.Service;
|
|
|
|
public class ServiceUpdateValidator : AbstractValidator<ServiceUpdateDto>
|
|
{
|
|
public ServiceUpdateValidator()
|
|
{
|
|
RuleFor(x => x.Nom)
|
|
.NotEmpty().WithMessage("Le nom est requis.")
|
|
.MaximumLength(50).WithMessage("Le nom ne doit pas dépasser 50 caractères.");
|
|
RuleFor(x => x.Id)
|
|
.NotEmpty().WithMessage("L'identifiant du service est requis.");
|
|
|
|
}
|
|
|
|
} |