Ejemplo n.º 1
0
 public QuestionManager(ICategoryRepositoryAsync categoryRepo,
                        IQuestionRepositoryAsync questionRepo)
 {
     _categoryRepo   = categoryRepo;
     _questionRepo   = questionRepo;
     _categoryMapper = new CategoryToCategoryMapper();
     _questionMapper = new QuestionToQuestionMapper();
 }
Ejemplo n.º 2
0
 public CreateQuestionCommandHandler(IQuestionRepositoryAsync questionRepository,
                                     IAnswerRepositoryAsync answerRepository,
                                     IMapper mapper)
 {
     _questionRepository = questionRepository;
     _mapper             = mapper;
     _answerRepository   = answerRepository;
 }
Ejemplo n.º 3
0
 public QuestionManager(ICategoryRepositoryAsync categoryRepo,
     IQuestionRepositoryAsync questionRepo)
 {
     _categoryRepo = categoryRepo;
     _questionRepo = questionRepo;
     _categoryMapper = new CategoryToCategoryMapper();
     _questionMapper = new QuestionToQuestionMapper();
 }
Ejemplo n.º 4
0
        public async void Setup()
        {
            _questionRepo = DependencyResolver.Container.GetInstance<IQuestionRepositoryAsync>();
            _commandBus = DependencyResolver.Container.GetInstance<ICommandBus>();
            _eventBus = DependencyResolver.Container.GetInstance<IEventBus>();
            _aggregateRepo = DependencyResolver.Container.GetInstance<IAggregateRepositoryAsync>();

            await _questionRepo.GetAllAsync();
            await _aggregateRepo.GetAllAsync();
        }
Ejemplo n.º 5
0
        public async void Setup()
        {
            _questionRepo  = DependencyResolver.Container.GetInstance <IQuestionRepositoryAsync>();
            _commandBus    = DependencyResolver.Container.GetInstance <ICommandBus>();
            _eventBus      = DependencyResolver.Container.GetInstance <IEventBus>();
            _aggregateRepo = DependencyResolver.Container.GetInstance <IAggregateRepositoryAsync>();

            await _questionRepo.GetAllAsync();

            await _aggregateRepo.GetAllAsync();
        }
Ejemplo n.º 6
0
 public void Setup()
 {
     _categoryRepo = DependencyResolver.Container.GetInstance<ICategoryRepositoryAsync>();
     _commandBus = DependencyResolver.Container.GetInstance<ICommandBus>();
     _eventBus = DependencyResolver.Container.GetInstance<IEventBus>();
     _userCategoryRepository = DependencyResolver.Container.GetInstance<IRepository<UserCategory>>();
     _eventHandlerFactory = DependencyResolver.Container.GetInstance<IEventHandlerFactory>();
     _stateHelper = DependencyResolver.Container.GetInstance<IStateHelper>();
     _aggregateRepository = DependencyResolver.Container.GetInstance<IAggregateRepositoryAsync>();
     _eventRepository = DependencyResolver.Container.GetInstance<IEventRepositoryAsync>();
     _mementoRepository = DependencyResolver.Container.GetInstance<IMementoRepositoryAsync>();
     _questionRepository = DependencyResolver.Container.GetInstance<IQuestionRepositoryAsync>();
 }
Ejemplo n.º 7
0
 public void Setup()
 {
     _categoryRepo           = DependencyResolver.Container.GetInstance <ICategoryRepositoryAsync>();
     _commandBus             = DependencyResolver.Container.GetInstance <ICommandBus>();
     _eventBus               = DependencyResolver.Container.GetInstance <IEventBus>();
     _userCategoryRepository = DependencyResolver.Container.GetInstance <IRepository <UserCategory> >();
     _eventHandlerFactory    = DependencyResolver.Container.GetInstance <IEventHandlerFactory>();
     _stateHelper            = DependencyResolver.Container.GetInstance <IStateHelper>();
     _aggregateRepository    = DependencyResolver.Container.GetInstance <IAggregateRepositoryAsync>();
     _eventRepository        = DependencyResolver.Container.GetInstance <IEventRepositoryAsync>();
     _mementoRepository      = DependencyResolver.Container.GetInstance <IMementoRepositoryAsync>();
     _questionRepository     = DependencyResolver.Container.GetInstance <IQuestionRepositoryAsync>();
 }
        public CreateQuestionCommandValidator(IQuestionRepositoryAsync questionRepository)
        {
            this.questionRepository = questionRepository;

            RuleFor(q => q.QuesContent)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull();

            RuleFor(q => q.QuesCode)
            .NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull()
            .MustAsync(IsUniqueQuestioncode).WithMessage("{PropertyName} already exists.");

            RuleFor(q => q.QuesContentText)
            .NotEmpty().WithMessage("{PropertyName} is required")
            .NotNull();
        }
Ejemplo n.º 9
0
 public DeleteQuestionIdCommandHandler(IQuestionRepositoryAsync questionRepository)
 {
     _questionRepository = questionRepository;
 }
 public QuestionCreatedEventHandler(IQuestionRepositoryAsync questionRepository)
 {
     _questionRepo = questionRepository;
 }
 public QuestionTextChangedEventHandler(IQuestionRepositoryAsync questionRepo)
 {
     _questionRepo = questionRepo;
 }
 public QuestionDeletedEventHandler(IQuestionRepositoryAsync questionRepo)
 {
     _questionRepo = questionRepo;
 }