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; }
public CreateMasterCommandHandler(IMasterRepositoryAsync masterRepository, IMasterUnitRepositoryAsync masterUnitRepository, IMapper mapper) { _masterRepository = masterRepository; _masterUnitRepository = masterUnitRepository; _mapper = mapper; }
public GetAllMastersQueryHandler(IMasterRepositoryAsync masterRepository, IMapper mapper) { _masterRepository = masterRepository; _mapper = mapper; }
public UpdateMasterCommandHandler(IMasterRepositoryAsync masterRepository) { _masterRepository = masterRepository; }
public GetMasterByIdQueryHandler(IMasterRepositoryAsync masterRepository) { _masterRepository = masterRepository; }