18 lines
404 B
C#
18 lines
404 B
C#
using FluentValidation;
|
|
using zero.Core.Database;
|
|
using zero.Core.Entities;
|
|
using zero.Core.Extensions;
|
|
using zero.Core.Validation;
|
|
|
|
namespace zero.Core.Collections
|
|
{
|
|
public class CountryValidator : ZeroValidator<Country>
|
|
{
|
|
public CountryValidator(IZeroDocumentSession session)
|
|
{
|
|
RuleFor(x => x.Code).Length(2).Unique(session);
|
|
RuleFor(x => x.Name).Length(2, 120);
|
|
}
|
|
}
|
|
}
|