UpdateQuestionKnowladgeDtoValidator.cs 714 B

1234567891011121314151617
  1. using Exam.Infrastructure.Extensions;
  2. using FluentValidation;
  3. using Hotline.Exams.Questions;
  4. using Hotline.Exams.Validate;
  5. using Hotline.Share.Dtos.Questions;
  6. namespace Hotline.Validators.Exams
  7. {
  8. public class UpdateQuestionKnowladgeDtoValidator:AbstractValidator<UpdateQuestionKnowladgeDto>
  9. {
  10. public UpdateQuestionKnowladgeDtoValidator()
  11. {
  12. RuleFor(m => m.KnowladgeId).NotEmpty().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, typeof(Hotline.KnowledgeBase.Knowledge).GetDescription()));
  13. RuleFor(m => m.Id).NotEmpty().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, x.GetType().GetDescription(nameof(ExamQuestion.Id))));
  14. }
  15. }
  16. }