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