22 lines
656 B
C#
22 lines
656 B
C#
using FluentValidation;
|
|
|
|
namespace CleanArchitecture.Application.Features.Videos.Commands.UpdateVideo
|
|
{
|
|
public class UpdateVideoCommandValidator: AbstractValidator<UpdateVideoCommand>
|
|
{
|
|
public UpdateVideoCommandValidator()
|
|
{
|
|
|
|
RuleFor(x=>x.Nombre)
|
|
.NotEmpty().WithMessage("{Nombre} is required.")
|
|
.NotNull()
|
|
.MaximumLength(50).WithMessage("{Nombre} must not exceed 50 characters.");
|
|
|
|
RuleFor(x => x.Id)
|
|
.NotEmpty().WithMessage("{Id} is required.")
|
|
.NotNull();
|
|
|
|
}
|
|
}
|
|
}
|