Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

790 B
Raw Blame
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
using Grand.Web.AdminShared.Models.Vendors;

namespace Grand.Web.AdminShared.Validators.Vendors;

public class VendorReviewValidator : BaseGrandValidator<VendorReviewModel>
{
    public VendorReviewValidator(
        IEnumerable<IValidatorConsumer<VendorReviewModel>> validators,
        ITranslationService translationService)
        : base(validators)
    {
        RuleFor(x => x.Title).NotEmpty()
            .WithMessage(translationService.GetResource("Admin.VendorReviews.Fields.Title.Required"));
        RuleFor(x => x.ReviewText).NotEmpty()
            .WithMessage(translationService.GetResource("Admin.VendorReviews.Fields.ReviewText.Required"));
    }
}