using FluentValidation;
using Nop.Web.Areas.Admin.Models.Topics;
using Nop.Core.Domain.Topics;
using Nop.Data;
using Nop.Services.Localization;
using Nop.Services.Seo;
using Nop.Web.Framework.Validators;
using Nop.Core.Domain.TopicSideMenu;
using Nop.Web.Areas.Admin.Models.TopicSideMenu;

namespace Nop.Web.Areas.Admin.Validators.Topics
{
    public partial class TopicSideMenuValidator : BaseNopValidator<TopicSideMenuModel>
    {
        public TopicSideMenuValidator(ILocalizationService localizationService, IDbContext dbContext)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Catalog.Categories.Fields.Name.Required"));

            SetDatabaseValidationRules<TopicSideMenu>(dbContext);
        }
    }
}
