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

17 lines
363 B
C#
Raw Normal View History

2020-04-22 15:46:35 +02:00
using FluentValidation;
2020-09-08 16:15:39 +02:00
using zero.Core.Api;
2020-04-22 15:46:35 +02:00
using zero.Core.Entities;
2020-09-08 16:15:39 +02:00
using zero.Core.Extensions;
2020-04-22 15:46:35 +02:00
namespace zero.Core.Validation
{
public class CountryValidator : ZeroValidator<ICountry>
2020-04-22 15:46:35 +02:00
{
2020-09-09 11:02:22 +02:00
public CountryValidator(IBackofficeStore store)
2020-04-22 15:46:35 +02:00
{
2020-09-09 11:02:22 +02:00
RuleFor(x => x.Code).Length(2).Unique(store);
2020-04-22 15:46:35 +02:00
RuleFor(x => x.Name).Length(2, 120);
}
}
}