14 lines
511 B
C#
14 lines
511 B
C#
using FluentValidation;
|
|
using Nop.Services.Localization;
|
|
using Nop.Web.Framework.Validators;
|
|
using Nop.Web.Models.Blogs;
|
|
|
|
namespace Nop.Web.Validators.Blogs;
|
|
|
|
public partial class BlogPostValidator : BaseNopValidator<BlogPostModel>
|
|
{
|
|
public BlogPostValidator(ILocalizationService localizationService)
|
|
{
|
|
RuleFor(x => x.AddNewComment.CommentText).NotEmpty().WithMessageAwait(localizationService.GetResourceAsync("Blog.Comments.CommentText.Required")).When(x => x.AddNewComment != null);
|
|
}
|
|
} |