[Validator(typeof(PublicAfilliatePageValidator))]
to the top of the model, causes an error.Model:
using FluentValidation.Attributes;
using Nop.Plugin.Marketing.AffiliateProgram.Validators;
using Nop.Web.Framework;
using Nop.Web.Framework.Mvc;
using Nop.Web.Models.Common;
namespace Nop.Plugin.Marketing.AffiliateProgram.Models
{
[Validator(typeof(PublicAfilliatePageValidator))]
public class PublicAfilliatePageModel : BaseNopModel
{
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.Active")]
public bool Active { get; set; }
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.Url")]
public string Url { get; set; }
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.FriendlyUrlName")]
public string FriendlyUrlName { get; set; }
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.Credit")]
public decimal Credit { get; set; }
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.CreditNextPayment")]
public decimal CreditNextPayment { get; set; }
[NopResourceDisplayName("Plugins.Marketing.AffiliateProgram.Fields.Iban")]
public string Iban { get; set; }
public AddressModel Address { get; set; }
}
}
Validator
using FluentValidation;
using Nop.Core.Domain.Customers;
using Nop.Plugin.Marketing.AffiliateProgram.Models;
using Nop.Services.Localization;
namespace Nop.Plugin.Marketing.AffiliateProgram.Validators
{
public class PublicAfilliatePageValidator : AbstractValidator<PublicAfilliatePageModel>
{
PublicAfilliatePageValidator(ILocalizationService localizationService,
CustomerSettings customerSettings)
{
RuleFor(x => x.Iban).NotEmpty().WithMessage(localizationService.GetResource("trewtwer"));
RuleFor(x => x.FriendlyUrlName).NotEmpty().WithMessage(localizationService.GetResource("fsefse"));
}
}
}
Source error: https://pastebin.com/9vqrFjV7
Stacktrace: https://pastebin.com/ZLzCSwcD