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

18 lines
492 B
C#
Raw Normal View History

2021-11-23 22:56:22 +01:00
using FluentValidation;
2021-11-24 13:56:08 +01:00
namespace zero.Localization;
2021-11-23 22:56:22 +01:00
2021-11-26 12:31:33 +01:00
public class CountryStore : EntityStore<Country>, ICountryStore
2021-11-23 22:56:22 +01:00
{
2021-11-26 12:31:33 +01:00
public CountryStore(IStoreContext context) : base(context) { }
2021-11-23 22:56:22 +01:00
/// <inheritdoc />
protected override void ValidationRules(ZeroValidator<Country> validator)
{
2022-01-14 11:51:38 +01:00
validator.RuleFor(x => x.Code).NotEmpty().Length(2).Unique(Session);
validator.RuleFor(x => x.Name).NotEmpty().Length(2, 120);
2021-11-23 22:56:22 +01:00
}
}
2021-11-26 12:31:33 +01:00
public interface ICountryStore : IEntityStore<Country> { }