autobus-api_old/AutobusApi.Application/Buses/Commands/CreateBus/CreateBusCommandValidator.cs

16 lines
400 B
C#

using FluentValidation;
namespace AutobusApi.Application.Buses.Commands.CreateBus;
public class CreateBusCommandValidator : AbstractValidator<CreateBusCommand>
{
public CreateBusCommandValidator()
{
RuleFor(v => v.Number).MinimumLength(8).MaximumLength(8);
RuleFor(v => v.Model).MinimumLength(2).MaximumLength(64);
RuleFor(v => v.Capacity).GreaterThan(0);
}
}