api/NetinaCMS.Repository/Handlers/Blogs/Validators/CreateBlogCommandValidator.cs

27 lines
814 B
C#

namespace NetinaCMS.Repository.Handlers.Blogs.Validators;
public class CreateBlogCommandValidator : AbstractValidator<CreateBlogCommand>
{
public CreateBlogCommandValidator()
{
RuleFor(b => b.Content)
.NotNull()
.NotEmpty()
.WithMessage("محتوا بلاگ نمی تواند خالی باشد");
RuleFor(b => b.Title)
.NotNull()
.NotEmpty()
.WithMessage("عنوان بلاگ را وارد کنید");
RuleFor(b => b.Tags)
.NotNull()
.NotEmpty()
.WithMessage("تگ های بلاگ را وارد کنید");
RuleFor(b => b.Summery)
.NotNull()
.NotEmpty()
.WithMessage("خلاصه بلاگ را واردی کنید");
}
}