public CreateMasterCommandValidator(IMasterRepositoryAsync masterRepository)
        {
            this.masterRepository = masterRepository;

            RuleFor(m => m.TypeMasters)
            .NotEmpty().WithMessage("{PropertyName} is required.");

            RuleFor(m => m.Key)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull()
            .MaximumLength(50).WithMessage("{PropertyName} must not exceed 50 characters.")
            .Matches(@"^[\ A-Za-z0-9]$").WithMessage("{PropertyName} does not allow special character.");

            RuleFor(m => m.Value)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull()
            .MaximumLength(500).WithMessage("{PropertyName} must not exceed 500 characters.");
        }
 public DeleteMasterByIdCommandHandler(IMasterRepositoryAsync masterRepository)
 {
     _masterRepository = masterRepository;
 }
Пример #3
0
 public CreateMasterCommandHandler(IMasterRepositoryAsync masterRepository, IMasterUnitRepositoryAsync masterUnitRepository, IMapper mapper)
 {
     _masterRepository     = masterRepository;
     _masterUnitRepository = masterUnitRepository;
     _mapper = mapper;
 }
Пример #4
0
 public GetAllMastersQueryHandler(IMasterRepositoryAsync masterRepository, IMapper mapper)
 {
     _masterRepository = masterRepository;
     _mapper           = mapper;
 }
Пример #5
0
 public UpdateMasterCommandHandler(IMasterRepositoryAsync masterRepository)
 {
     _masterRepository = masterRepository;
 }
Пример #6
0
 public GetMasterByIdQueryHandler(IMasterRepositoryAsync masterRepository)
 {
     _masterRepository = masterRepository;
 }