Spaces:
Runtime error
Runtime error
File size: 561 Bytes
de8b914 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | using FluentValidation;
using SCM.Application.Obras.Dtos;
using SCM.Domain.Obras;
namespace SCM.Application.Obras.Validators;
public sealed class UpdateObraRequestValidator : AbstractValidator<UpdateObraRequest>
{
public UpdateObraRequestValidator()
{
RuleFor(x => x.Codigo)
.NotEmpty().WithMessage("O código da obra é obrigatório.")
.MaximumLength(Obra.MaxCodigo);
RuleFor(x => x.Nome)
.NotEmpty().WithMessage("O nome da obra é obrigatório.")
.MaximumLength(Obra.MaxNome);
}
}
|