Files
mixtape/zero.Core/Localization/CountryValidator.cs
T

12 lines
281 B
C#
Raw Normal View History

using FluentValidation;
namespace zero.Localization;
public class CountryValidator : ZeroValidator<Country>
{
2022-01-24 00:08:44 +01:00
public CountryValidator(IZeroStore store)
{
2022-01-24 00:08:44 +01:00
RuleFor(x => x.Code).NotEmpty().Length(2).Unique(store);
RuleFor(x => x.Name).NotEmpty().Length(2, 120);
}
}