using FluentValidation;
using Microsoft.Extensions.Options;
using OnlineAssessment.Common;
using OnlineAssessment.Domain.ViewModels;

namespace OnlineAssessment.Validators
{
    public class SubjectAddModelValidator : AbstractValidator<SubjectAddModel>
    {
        public SubjectAddModelValidator()
        {
            RuleFor(c => c.name)
               .NotEmpty()
               .NotNull()
               .MaximumLength(500);

            

        }
    }

    public class SubjectEditModelValidator : AbstractValidator<SubjectEditModel>
    {
        private readonly ResponseMessage _responseMessage;
        public SubjectEditModelValidator(IOptionsSnapshot<ResponseMessage> responseMessage)
        {
            _responseMessage = responseMessage.Value;

            RuleFor(c => c.name)
               .NotEmpty()
               .NotNull()
               .MaximumLength(500);

        }
    }
}
