Example #1
0
        public CreatePositionCommandValidator(IPositionRepositoryAsync positionRepository)
        {
            this.positionRepository = positionRepository;

            RuleFor(p => p.PositionNumber)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull()
            .MaximumLength(50).WithMessage("{PropertyName} must not exceed 50 characters.")
            .MustAsync(IsUniquePositionNumber).WithMessage("{PropertyName} already exists.");

            RuleFor(p => p.PositionTitle)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull()
            .MaximumLength(50).WithMessage("{PropertyName} must not exceed 50 characters.");
        }
Example #2
0
 public UpdatePositionCommandHandler(IPositionRepositoryAsync positionRepository)
 {
     _positionRepository = positionRepository;
 }
Example #3
0
 public GetAllPositionsQueryHandler(IPositionRepositoryAsync positionRepository, IMapper mapper, IModelHelper modelHelper)
 {
     _positionRepository = positionRepository;
     _mapper             = mapper;
     _modelHelper        = modelHelper;
 }
 public DeletePositionByIdCommandHandler(IPositionRepositoryAsync positionRepository)
 {
     _positionRepository = positionRepository;
 }
Example #5
0
 public GetPositionByIdQueryHandler(IPositionRepositoryAsync positionRepository)
 {
     _positionRepository = positionRepository;
 }
Example #6
0
 public CreatePositionCommandHandler(IPositionRepositoryAsync positionRepository, IMapper mapper)
 {
     _positionRepository = positionRepository;
     _mapper             = mapper;
 }
 public SeedPositionCommandHandler(IPositionRepositoryAsync positionRepository)
 {
     _positionRepository = positionRepository;
 }