コード例 #1
0
        public PushNotificationValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.MessageTitle).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.PushNotification.PushNotifications.Fields.MessageTitle.Required"));
            RuleFor(x => x.MessageBody).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.PushNotification.PushNotifications.Fields.MessageBody.Required"));

            SetDatabaseValidationRules <CustomerRole>(dataProvider);
        }
コード例 #2
0
 public Aws3PictureService(INopDataProvider dataProvider,
                           IDownloadService downloadService,
                           ICacheKeyService cacheKeyService,
                           IEventPublisher eventPublisher,
                           IHttpContextAccessor httpContextAccessor,
                           INopFileProvider fileProvider,
                           IProductAttributeParser productAttributeParser,
                           IRepository <Picture> pictureRepository,
                           IRepository <PictureBinary> pictureBinaryRepository,
                           IRepository <ProductPicture> productPictureRepository,
                           ISettingService settingService,
                           IStaticCacheManager staticCacheManager,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           MediaSettings mediaSettings,
                           EzkelTechAwsS3Settings awsS3Settings)
     : base(dataProvider,
            downloadService,
            eventPublisher,
            httpContextAccessor,
            fileProvider,
            productAttributeParser,
            pictureRepository,
            pictureBinaryRepository,
            productPictureRepository,
            settingService,
            urlRecordService,
            webHelper,
            mediaSettings)
 {
     _cacheKeyService     = cacheKeyService;
     _staticCacheManager  = staticCacheManager;
     _httpContextAccessor = httpContextAccessor;
     _awsS3Settings       = awsS3Settings;
 }
コード例 #3
0
        public StoreValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Configuration.Stores.Fields.Name.Required"));
            RuleFor(x => x.Url).NotEmpty().WithMessage(localizationService.GetResource("Admin.Configuration.Stores.Fields.Url.Required"));

            SetDatabaseValidationRules <Store>(dataProvider);
        }
コード例 #4
0
ファイル: FakeCustomerService.cs プロジェクト: sargiss/obvius
 public FakeCustomerService(CustomerSettings customerSettings = null,
                            ICacheManager cacheManager        = null,
                            INopDataProvider dataProvider     = null,
                            IEventPublisher eventPublisher    = null,
                            IGenericAttributeService genericAttributeService = null,
                            IRepository <Address> customerAddressRepository  = null,
                            IRepository <Customer> customerRepository        = null,
                            IRepository <CustomerAddressMapping> customerAddressMappingRepository           = null,
                            IRepository <CustomerCustomerRoleMapping> customerCustomerRoleMappingRepository = null,
                            IRepository <CustomerPassword> customerPasswordRepository = null,
                            IRepository <CustomerRole> customerRoleRepository         = null,
                            IRepository <GenericAttribute> gaRepository           = null,
                            IRepository <ShoppingCartItem> shoppingCartRepository = null,
                            IStoreContext storeContext = null,
                            ShoppingCartSettings shoppingCartSettings = null) : base(
         customerSettings ?? new CustomerSettings(),
         cacheManager ?? new TestCacheManager(),
         dataProvider ?? new Mock <INopDataProvider>().Object,
         eventPublisher ?? new Mock <IEventPublisher>().Object,
         genericAttributeService ?? new Mock <IGenericAttributeService>().Object,
         customerAddressRepository.FakeRepoNullPropagation(),
         customerRepository.FakeRepoNullPropagation(),
         customerAddressMappingRepository.FakeRepoNullPropagation(),
         customerCustomerRoleMappingRepository.FakeRepoNullPropagation(),
         customerPasswordRepository.FakeRepoNullPropagation(),
         customerRoleRepository.FakeRepoNullPropagation(),
         gaRepository.FakeRepoNullPropagation(),
         shoppingCartRepository.FakeRepoNullPropagation(),
         new TestCacheManager(),
         storeContext ?? new Mock <IStoreContext>().Object,
         shoppingCartSettings ?? new ShoppingCartSettings())
 {
 }
コード例 #5
0
        public ReviewTypeValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Settings.ReviewType.Fields.Name.Required"));
            RuleFor(x => x.Description).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Settings.ReviewType.Fields.Description.Required"));

            SetDatabaseValidationRules <ReviewType>(dataProvider);
        }
コード例 #6
0
 public EnhancedClearLogTask(
     INopDataProvider nopDataProvider,
     EnhancedLoggingSettings settings)
 {
     _nopDataProvider = nopDataProvider;
     _settings        = settings;
 }
コード例 #7
0
        public ScheduleTaskValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.System.ScheduleTasks.Name.Required"));
            RuleFor(x => x.Seconds).GreaterThan(0).WithMessageAwait(localizationService.GetResourceAsync("Admin.System.ScheduleTasks.Seconds.Positive"));

            SetDatabaseValidationRules <ScheduleTask>(dataProvider);
        }
コード例 #8
0
ファイル: TopicValidator.cs プロジェクト: sargiss/obvius
        public TopicValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.SeName).Length(0, NopSeoDefaults.ForumTopicLength)
            .WithMessage(string.Format(localizationService.GetResource("Admin.SEO.SeName.MaxLengthValidation"), NopSeoDefaults.ForumTopicLength));

            SetDatabaseValidationRules <Topic>(dataProvider);
        }
コード例 #9
0
ファイル: AzurePictureService.cs プロジェクト: Sakchai/eStore
        public AzurePictureService(AppSettings appSettings,
                                   INopDataProvider dataProvider,
                                   IDownloadService downloadService,
                                   IHttpContextAccessor httpContextAccessor,
                                   INopFileProvider fileProvider,
                                   IProductAttributeParser productAttributeParser,
                                   IRepository <Picture> pictureRepository,
                                   IRepository <PictureBinary> pictureBinaryRepository,
                                   IRepository <ProductPicture> productPictureRepository,
                                   ISettingService settingService,
                                   IStaticCacheManager staticCacheManager,
                                   IUrlRecordService urlRecordService,
                                   IWebHelper webHelper,
                                   MediaSettings mediaSettings)
            : base(dataProvider,
                   downloadService,
                   httpContextAccessor,
                   fileProvider,
                   productAttributeParser,
                   pictureRepository,
                   pictureBinaryRepository,
                   productPictureRepository,
                   settingService,
                   urlRecordService,
                   webHelper,
                   mediaSettings)
        {
            _staticCacheManager = staticCacheManager;
            _mediaSettings      = mediaSettings;

            OneTimeInit(appSettings);
        }
コード例 #10
0
        public CompanyValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Company.Companies.Fields.Name.Required"));
            RuleFor(x => x.AmountLimit).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Company.Companies.Fields.Name.AmountLimit"));

            SetDatabaseValidationRules <Company>(dataProvider);
        }
コード例 #11
0
        public ReturnRequestValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.ReasonForReturn).NotEmpty().WithMessage(localizationService.GetResource("Admin.ReturnRequests.Fields.ReasonForReturn.Required"));
            RuleFor(x => x.RequestedAction).NotEmpty().WithMessage(localizationService.GetResource("Admin.ReturnRequests.Fields.RequestedAction.Required"));

            SetDatabaseValidationRules <ReturnRequest>(dataProvider);
        }
コード例 #12
0
 public CommonController(ICommonModelFactory commonModelFactory,
                         ICustomerService customerService,
                         INopDataProvider dataProvider,
                         IDateTimeHelper dateTimeHelper,
                         ILanguageService languageService,
                         ILocalizationService localizationService,
                         IMaintenanceService maintenanceService,
                         INopFileProvider fileProvider,
                         INotificationService notificationService,
                         IPermissionService permissionService,
                         IQueuedEmailService queuedEmailService,
                         IShoppingCartService shoppingCartService,
                         IStaticCacheManager staticCacheManager,
                         IUrlRecordService urlRecordService,
                         IWebHelper webHelper,
                         IWorkContext workContext)
 {
     _commonModelFactory  = commonModelFactory;
     _customerService     = customerService;
     _dataProvider        = dataProvider;
     _dateTimeHelper      = dateTimeHelper;
     _languageService     = languageService;
     _localizationService = localizationService;
     _maintenanceService  = maintenanceService;
     _fileProvider        = fileProvider;
     _notificationService = notificationService;
     _permissionService   = permissionService;
     _queuedEmailService  = queuedEmailService;
     _shoppingCartService = shoppingCartService;
     _staticCacheManager  = staticCacheManager;
     _urlRecordService    = urlRecordService;
     _webHelper           = webHelper;
     _workContext         = workContext;
 }
コード例 #13
0
ファイル: PictureService.cs プロジェクト: FarhanQ7/MAli_site
 public PictureService(INopDataProvider dataProvider,
                       IDownloadService downloadService,
                       IHttpContextAccessor httpContextAccessor,
                       INopFileProvider fileProvider,
                       IProductAttributeParser productAttributeParser,
                       IRepository <Picture> pictureRepository,
                       IRepository <PictureBinary> pictureBinaryRepository,
                       IRepository <ProductPicture> productPictureRepository,
                       ISettingService settingService,
                       IUrlRecordService urlRecordService,
                       IWebHelper webHelper,
                       MediaSettings mediaSettings)
 {
     _dataProvider             = dataProvider;
     _downloadService          = downloadService;
     _httpContextAccessor      = httpContextAccessor;
     _fileProvider             = fileProvider;
     _productAttributeParser   = productAttributeParser;
     _pictureRepository        = pictureRepository;
     _pictureBinaryRepository  = pictureBinaryRepository;
     _productPictureRepository = productPictureRepository;
     _settingService           = settingService;
     _urlRecordService         = urlRecordService;
     _webHelper     = webHelper;
     _mediaSettings = mediaSettings;
 }
コード例 #14
0
        public CurrencyValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name)
            .NotEmpty().WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.Name.Required"))
            .Length(1, 50).WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.Name.Range"));
            RuleFor(x => x.CurrencyCode)
            .NotEmpty().WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.CurrencyCode.Required"))
            .Length(1, 5).WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.CurrencyCode.Range"));
            RuleFor(x => x.Rate)
            .GreaterThan(0).WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.Rate.Range"));
            RuleFor(x => x.CustomFormatting)
            .Length(0, 50).WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.CustomFormatting.Validation"));
            RuleFor(x => x.DisplayLocale)
            .Must(x =>
            {
                try
                {
                    if (string.IsNullOrEmpty(x))
                    {
                        return(true);
                    }
                    //let's try to create a CultureInfo object
                    //if "DisplayLocale" is wrong, then exception will be thrown
                    var unused = new CultureInfo(x);
                    return(true);
                }
                catch
                {
                    return(false);
                }
            })
            .WithMessage(localizationService.GetResource("Admin.Configuration.Currencies.Fields.DisplayLocale.Validation"));

            SetDatabaseValidationRules <Currency>(dataProvider);
        }
コード例 #15
0
        public TopicTemplateValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.System.Templates.Topic.Name.Required"));
            RuleFor(x => x.ViewPath).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.System.Templates.Topic.ViewPath.Required"));

            SetDatabaseValidationRules <TopicTemplate>(dataProvider);
        }
コード例 #16
0
        public NopConventionSet(INopDataProvider dataProvider)
        {
            if (dataProvider is null)
            {
                throw new ArgumentNullException(nameof(dataProvider));
            }

            var defaultConventionSet = new DefaultConventionSet();

            ForeignKeyConventions = new List <IForeignKeyConvention>()
            {
                new NopForeignKeyConvention(dataProvider),
                defaultConventionSet.SchemaConvention,
            };

            IndexConventions = new List <IIndexConvention>()
            {
                new NopIndexConvention(dataProvider),
                defaultConventionSet.SchemaConvention
            };

            ColumnsConventions = new List <IColumnsConvention>()
            {
                new NopColumnsConvention(),
                new DefaultPrimaryKeyNameConvention()
            };

            ConstraintConventions = defaultConventionSet.ConstraintConventions;

            SequenceConventions = defaultConventionSet.SequenceConventions;
            AutoNameConventions = defaultConventionSet.AutoNameConventions;
            SchemaConvention    = defaultConventionSet.SchemaConvention;
            RootPathConvention  = defaultConventionSet.RootPathConvention;
        }
コード例 #17
0
 public AbcTaxProvider(AbcTaxSettings abcTaxSettings,
                       IAbcTaxService abcTaxService,
                       ICountryService countryService,
                       IGenericAttributeService genericAttributeService,
                       IHttpContextAccessor httpContextAccessor,
                       ILocalizationService localizationService,
                       INopDataProvider nopDataProvider,
                       IOrderTotalCalculationService orderTotalCalculationService,
                       IPaymentService paymentService,
                       ISettingService settingService,
                       IStaticCacheManager staticCacheManager,
                       ITaxCategoryService taxCategoryService,
                       ITaxjarRateService taxjarRateService,
                       ITaxService taxService,
                       IWebHelper webHelper,
                       TaxSettings taxSettings)
 {
     _abcTaxSettings               = abcTaxSettings;
     _abcTaxService                = abcTaxService;
     _countryService               = countryService;
     _genericAttributeService      = genericAttributeService;
     _httpContextAccessor          = httpContextAccessor;
     _localizationService          = localizationService;
     _nopDataProvider              = nopDataProvider;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentService               = paymentService;
     _settingService               = settingService;
     _staticCacheManager           = staticCacheManager;
     _taxCategoryService           = taxCategoryService;
     _taxjarRateService            = taxjarRateService;
     _taxService  = taxService;
     _webHelper   = webHelper;
     _taxSettings = taxSettings;
 }
コード例 #18
0
        public MessageTemplateValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Subject).NotEmpty().WithMessage(localizationService.GetResource("Admin.ContentManagement.MessageTemplates.Fields.Subject.Required"));
            RuleFor(x => x.Body).NotEmpty().WithMessage(localizationService.GetResource("Admin.ContentManagement.MessageTemplates.Fields.Body.Required"));

            SetDatabaseValidationRules <MessageTemplate>(dataProvider);
        }
コード例 #19
0
        public MeasureDimensionValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Shipping.Measures.Dimensions.Fields.Name.Required"));
            RuleFor(x => x.SystemKeyword).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Shipping.Measures.Dimensions.Fields.SystemKeyword.Required"));

            SetDatabaseValidationRules <MeasureDimension>(dataProvider);
        }
コード例 #20
0
        public LanguageValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Languages.Fields.Name.Required"));
            RuleFor(x => x.LanguageCulture)
            .Must(x =>
            {
                try
                {
                    //let's try to create a CultureInfo object
                    //if "DisplayLocale" is wrong, then exception will be thrown
                    var unused = new CultureInfo(x);
                    return(true);
                }
                catch
                {
                    return(false);
                }
            })
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Languages.Fields.LanguageCulture.Validation"));

            RuleFor(x => x.UniqueSeoCode).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Languages.Fields.UniqueSeoCode.Required"));
            RuleFor(x => x.UniqueSeoCode).Length(2).WithMessageAwait(localizationService.GetResourceAsync("Admin.Configuration.Languages.Fields.UniqueSeoCode.Length"));

            SetDatabaseValidationRules <Language>(dataProvider, "UniqueSeoCode");
        }
コード例 #21
0
        public CategoryTemplateValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.System.Templates.Category.Name.Required"));
            RuleFor(x => x.ViewPath).NotEmpty().WithMessage(localizationService.GetResource("Admin.System.Templates.Category.ViewPath.Required"));

            SetDatabaseValidationRules <CategoryTemplate>(dataProvider);
        }
コード例 #22
0
        public CategoryValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Admin.Catalog.Categories.Fields.Name.Required"));
            RuleFor(x => x.PageSizeOptions).Must(ValidatorUtilities.PageSizeOptionsValidator).WithMessageAwait(localizationService.GetResourceAsync("Admin.Catalog.Categories.Fields.PageSizeOptions.ShouldHaveUniqueItems"));
            RuleFor(x => x.PageSize).Must((x, context) =>
            {
                if (!x.AllowCustomersToSelectPageSize && x.PageSize <= 0)
                {
                    return(false);
                }

                return(true);
            }).WithMessageAwait(localizationService.GetResourceAsync("Admin.Catalog.Categories.Fields.PageSize.Positive"));
            RuleFor(x => x.SeName).Length(0, NopSeoDefaults.SearchEngineNameLength)
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.SEO.SeName.MaxLengthValidation"), NopSeoDefaults.SearchEngineNameLength);

            RuleFor(x => x.PriceFrom)
            .GreaterThanOrEqualTo(0)
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Catalog.Categories.Fields.PriceFrom.GreaterThanOrEqualZero"))
            .When(x => x.PriceRangeFiltering && x.ManuallyPriceRange);

            RuleFor(x => x.PriceTo)
            .GreaterThan(x => x.PriceFrom > decimal.Zero ? x.PriceFrom : decimal.Zero)
            .WithMessage(x => string.Format(localizationService.GetResourceAsync("Admin.Catalog.Categories.Fields.PriceTo.GreaterThanZeroOrPriceFrom").Result, x.PriceFrom > decimal.Zero ? x.PriceFrom : decimal.Zero))
            .When(x => x.PriceRangeFiltering && x.ManuallyPriceRange);

            SetDatabaseValidationRules <Category>(dataProvider);
        }
コード例 #23
0
        public ForumValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.ContentManagement.Forums.Forum.Fields.Name.Required"));
            RuleFor(x => x.ForumGroupId).NotEmpty().WithMessage(localizationService.GetResource("Admin.ContentManagement.Forums.Forum.Fields.ForumGroupId.Required"));

            SetDatabaseValidationRules <Forum>(dataProvider);
        }
コード例 #24
0
ファイル: AddressValidator.cs プロジェクト: Sakchai/eStore
        public AddressValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            var addressSettings = EngineContext.Current.Resolve <AddressSettings>();

            RuleFor(x => x.FirstName)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.FirstName.Required"));
            RuleFor(x => x.LastName)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.LastName.Required"));
            RuleFor(x => x.Email)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Email.Required"));
            RuleFor(x => x.Email)
            .EmailAddress()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Common.WrongEmail"));
            RuleFor(x => x.Company)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Company.Required"))
            .When(_ => addressSettings.CompanyEnabled && addressSettings.CompanyRequired);
            RuleFor(x => x.CountryId)
            .NotNull()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Country.Required"))
            .When(_ => addressSettings.CountryEnabled);
            RuleFor(x => x.CountryId)
            .NotEqual(0)
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Country.Required"))
            .When(_ => addressSettings.CountryEnabled);
            RuleFor(x => x.County)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.County.Required"))
            .When(_ => addressSettings.CountyEnabled && addressSettings.CountyRequired);
            RuleFor(x => x.City)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.City.Required"))
            .When(_ => addressSettings.CityEnabled && addressSettings.CityRequired);
            RuleFor(x => x.Address1)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Address1.Required"))
            .When(_ => addressSettings.StreetAddressEnabled && addressSettings.StreetAddressRequired);
            RuleFor(x => x.Address2)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.Address2.Required"))
            .When(_ => addressSettings.StreetAddress2Enabled && addressSettings.StreetAddress2Required);
            RuleFor(x => x.ZipPostalCode)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.ZipPostalCode.Required"))
            .When(_ => addressSettings.ZipPostalCodeEnabled && addressSettings.ZipPostalCodeRequired);
            RuleFor(x => x.PhoneNumber)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.PhoneNumber.Required"))
            .When(_ => addressSettings.PhoneEnabled && addressSettings.PhoneRequired);
            RuleFor(x => x.FaxNumber)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Admin.Address.Fields.FaxNumber.Required"))
            .When(_ => addressSettings.FaxEnabled && addressSettings.FaxRequired);

            SetDatabaseValidationRules <Address>(dataProvider);
        }
コード例 #25
0
        public ProductValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Admin.Catalog.Products.Fields.Name.Required"));
            RuleFor(x => x.SeName).Length(0, NopSeoDefaults.SearchEngineNameLength)
            .WithMessage(string.Format(localizationService.GetResource("Admin.SEO.SeName.MaxLengthValidation"), NopSeoDefaults.SearchEngineNameLength));

            SetDatabaseValidationRules <Product>(dataProvider);
        }
コード例 #26
0
        public CelebrityValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Name)
            .NotEmpty()
            .WithMessage(localizationService.GetResource("Admin.Catalog.Products.Fields.Name.Required"));

            SetDatabaseValidationRules <Product>(dataProvider);
        }
コード例 #27
0
ファイル: EntityRepository.cs プロジェクト: Sakchai/eStore
 public EntityRepository(IEventPublisher eventPublisher,
                         INopDataProvider dataProvider,
                         IStaticCacheManager staticCacheManager)
 {
     _eventPublisher     = eventPublisher;
     _dataProvider       = dataProvider;
     _staticCacheManager = staticCacheManager;
 }
コード例 #28
0
 public CartSlideoutController(
     IDeliveryService deliveryService,
     INopDataProvider nopDataProvider
     )
 {
     _deliveryService = deliveryService;
     _nopDataProvider = nopDataProvider;
 }
コード例 #29
0
        public EmailAccountValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            RuleFor(x => x.Email).NotEmpty();
            RuleFor(x => x.Email).EmailAddress().WithMessageAwait(localizationService.GetResourceAsync("Admin.Common.WrongEmail"));

            RuleFor(x => x.DisplayName).NotEmpty();

            SetDatabaseValidationRules <EmailAccount>(dataProvider);
        }
コード例 #30
0
        public SwiperSliderValidator(ILocalizationService localizationService, INopDataProvider dataProvider)
        {
            // Name boş geçilemez!
            RuleFor(m => m.Name)
            .NotEmpty()
            .WithMessageAwait(localizationService.GetResourceAsync("Nop.Plugin.Widgets.SwiperSlider.Sliders.Fields.Name.Required"));

            base.SetDatabaseValidationRules <Slider>(dataProvider);
        }