public ProductRepository(
     IQueryHandler<ProductListQuery, ProductListResult> queryHandler,
     IQueryHandler<ProductQuery, ProductQueryResult> productQueryHandler )
 {
     _queryHandler = queryHandler;
     _productQueryHandler = productQueryHandler;
 }
 public QueryHandlerConsumer(
     IQueryHandler<StaffForReviewQuery, IEnumerable<Person>> reviewHandler, 
     IQueryHandler<PersonByEmailQuery, Person> emailHandler)
 {
     this.reviewHandler = reviewHandler;
     this.emailHandler = emailHandler;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="queryHandler"><see cref="IQueryHandler"/> instance.</param>
 protected InterLinqContext(IQueryHandler queryHandler)
 {
     if (queryHandler == null)
     {
         throw new ArgumentException("queryHandler");
     }
     QueryHander = queryHandler;
 }
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="innerHandler">Inner Handler of this Server.</param>
 public ServerQueryRemotingHandler(IQueryHandler innerHandler)
 {
     if (innerHandler == null)
     {
         throw new ArgumentNullException("innerHandler");
     }
     this.InnerHandler = new ServerQueryHandler(innerHandler);
 }
 public OrganizationController(ICommandHandler<CreateOrganization, Organization> createOrganization,
     IQueryHandler<GetOrganization, Organization> getOrganization,
     IQueryHandler<ListOrganizations, IEnumerable<Organization>> listOrganizations)
 {
     _createOrganization = createOrganization;
     _getOrganization = getOrganization;
     _listOrganizations = listOrganizations;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueTransportOptionsFactory"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="queryOptions">The query options.</param>
        public SqLiteMessageQueueTransportOptionsFactory(IConnectionInformation connectionInformation,
            IQueryHandler<GetQueueOptionsQuery, SqLiteMessageQueueTransportOptions> queryOptions)
        {
            Guard.NotNull(() => queryOptions, queryOptions);
            Guard.NotNull(() => connectionInformation, connectionInformation);

            _queryOptions = queryOptions;
            _connectionInformation = connectionInformation;
        }
        public void SetUp()
        {
            _sut = new DecryptForLocalMachineScope();

              _taskLogger = _taskLogger.Fake();
              _sut.Logger = _taskLogger;
              _decryptForLocalMachineScopeQueryHandler = _decryptForLocalMachineScopeQueryHandler.Fake();
              _sut.DecryptForLocalMachineScopeQueryHandler = _decryptForLocalMachineScopeQueryHandler;
        }
Beispiel #8
0
        /// <summary>
        /// Creates ZyanServerQueryHandler instance.
        /// </summary>
        /// <param name="innerHandler">Inner Handler of this Server</param>
        public ZyanServerQueryHandler(IQueryHandler innerHandler)
        {
            if (innerHandler == null)
            {
                throw new ArgumentNullException("innerHandler");
            }

            InnerHandler = new ServerQueryHandler(innerHandler);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SqliteSendToJobQueue" /> class.
 /// </summary>
 /// <param name="queue">The queue.</param>
 /// <param name="doesJobExist">Query for determining if a job already exists</param>
 /// <param name="deleteMessageCommand">The delete message command.</param>
 /// <param name="getJobId">The get job identifier.</param>
 /// <param name="createJobMetaData">The create job meta data.</param>
 /// <param name="getTimeFactory">The get time factory.</param>
 public SqliteSendToJobQueue(IProducerMethodQueue queue, IQueryHandler<DoesJobExistQuery, QueueStatuses> doesJobExist,
     ICommandHandlerWithOutput<DeleteMessageCommand, long> deleteMessageCommand,
     IQueryHandler<GetJobIdQuery, long> getJobId, CreateJobMetaData createJobMetaData,
     IGetTimeFactory getTimeFactory): base(queue, getTimeFactory)
 {
     _doesJobExist = doesJobExist;
     _deleteMessageCommand = deleteMessageCommand;
     _getJobId = getJobId;
     _createJobMetaData = createJobMetaData;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlServerTime" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="connectionInformation">The connection information.</param>
 /// <param name="dateTimeQueryHandler">The date time query handler.</param>
 public SqlServerTime(ILogFactory log,
     BaseTimeConfiguration configuration,
     IConnectionInformation connectionInformation,
     IQueryHandler<GetUtcDateQuery, DateTime> dateTimeQueryHandler) : base(log, configuration)
 {
     Guard.NotNull(() => connectionInformation, connectionInformation);
     Guard.NotNull(() => dateTimeQueryHandler, dateTimeQueryHandler);
     _queryHandler = dateTimeQueryHandler;
     _connectionInformation = connectionInformation;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RedisSendJobToQueue" /> class.
 /// </summary>
 /// <param name="queue">The queue.</param>
 /// <param name="doesJobExist">Query for determining if a job already exists</param>
 /// <param name="deleteMessageCommand">The delete message command.</param>
 /// <param name="getJobId">The get job identifier.</param>
 /// <param name="getTimeFactory">The get time factory.</param>
 /// <param name="jobSchedulerMetaData">The job scheduler meta data.</param>
 public RedisSendJobToQueue(IProducerMethodQueue queue, IQueryHandler<DoesJobExistQuery, QueueStatuses> doesJobExist,
     ICommandHandlerWithOutput<DeleteMessageCommand, bool> deleteMessageCommand,
     IQueryHandler<GetJobIdQuery, string> getJobId, 
     IGetTimeFactory getTimeFactory, 
     IJobSchedulerMetaData jobSchedulerMetaData): base(queue, getTimeFactory)
 {
     _doesJobExist = doesJobExist;
     _deleteMessageCommand = deleteMessageCommand;
     _getJobId = getJobId;
     _jobSchedulerMetaData = jobSchedulerMetaData;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueResetHeartBeat"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="commandHandler">The command handler.</param>
        /// <param name="queryHandler">The query handler.</param>
        public SqlServerMessageQueueResetHeartBeat(QueueConsumerConfiguration configuration, 
            ICommandHandlerWithOutput<ResetHeartBeatCommand, long> commandHandler, 
            IQueryHandler<FindMessagesToResetByHeartBeatQuery, IEnumerable<MessageToReset>> queryHandler)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => commandHandler, commandHandler);
            Guard.NotNull(() => queryHandler, queryHandler);

            _configuration = configuration;
            _commandHandler = commandHandler;
            _queryHandler = queryHandler;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueClearExpiredMessages" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="findExpiredMessagesQueryHandler">The find expired messages query handler.</param>
        /// <param name="deleteMessageCommandHandler">The delete message command handler.</param>
        public PostgreSqlMessageQueueClearExpiredMessages(IConnectionInformation connectionInfo,
            IQueryHandler<FindExpiredMessagesToDeleteQuery, IEnumerable<long>> findExpiredMessagesQueryHandler, 
            ICommandHandlerWithOutput<DeleteMessageCommand, long> deleteMessageCommandHandler)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => findExpiredMessagesQueryHandler, findExpiredMessagesQueryHandler);
            Guard.NotNull(() => deleteMessageCommandHandler, deleteMessageCommandHandler);

            _connectionInfo = connectionInfo;
            _findExpiredMessagesQueryHandler = findExpiredMessagesQueryHandler;
            _deleteMessageCommandHandler = deleteMessageCommandHandler;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PostgreSqlMessageQueueStatusQueries"/> class.
 /// </summary>
 /// <param name="pendingQueryHandler">The pending query handler.</param>
 /// <param name="pendingExcludeDelayQueryHandler">The pending exclude delay query handler.</param>
 /// <param name="pendingDelayedQueryHandler">The pending delayed query handler.</param>
 /// <param name="workingQueryHandler">The working query handler.</param>
 /// <param name="errorQueryHandler">The error query handler.</param>
 public PostgreSqlMessageQueueStatusQueries(
     IQueryHandler<GetPendingCountQuery, long> pendingQueryHandler,
     IQueryHandler<GetPendingExcludeDelayCountQuery, long> pendingExcludeDelayQueryHandler,
     IQueryHandler<GetPendingDelayedCountQuery, long> pendingDelayedQueryHandler,
     IQueryHandler<GetWorkingCountQuery, long> workingQueryHandler,
     IQueryHandler<GetErrorCountQuery, long> errorQueryHandler)
 {
     PendingQueryHandler = pendingQueryHandler;
     PendingExcludeDelayQueryHandler = pendingExcludeDelayQueryHandler;
     PendingDelayedQueryHandler = pendingDelayedQueryHandler;
     WorkingQueryHandler = workingQueryHandler;
     ErrorQueryHandler = errorQueryHandler;
 }
        public void Context()
        {
            var container = Stub<IContainer>();
            IoC.Initialize(container);

            _testQueryHandler = Mock<IQueryHandler<TestQuery>>();
            _testQuery = new TestQuery();
            _testQueryHandler.Expect(a => a.Execute<bool>(Arg<TestQuery>.Matches(p => p == _testQuery))).Return(new[] { true });

            container.Stub(x => x.Resolve<IQueryHandler<TestQuery>>()).Return(_testQueryHandler);

            var queryExecutor = new QueryExecutor();
            _result = queryExecutor.Execute<TestQuery, bool>(_testQuery);
        }
Beispiel #16
0
 public UserService(
     IEmailService emailService,
     IRedisService redisService,
     IEncryptionService encryptionService,
     IMapper mapper,
     IHttpContextAccessor contextAccessor
     )
 {
     _emailService = emailService;
     _encryptionService = encryptionService;
     _mapper = mapper;
     _context = contextAccessor.HttpContext;
     _userQueryHandler = new UserQueryHandler(redisService);
 }
Beispiel #17
0
 public BooksController(
     IQueryHandler <GetBookQuery, BookInfo> getBookBaseInfoUseCase,
     IQueryHandler <GetBookQuery, BookInfoWithDetails> getBookInfoWithDetailsUseCase,
     IQueryHandler <GetBooksQuery, ICollection <BookInfo> > getBooksBaseInfoUseCase,
     ICommandHandler <AddNewBookCommand> addNewBookToStoreUseCase,
     ICommandHandler <StoreFileCommand> storeFileUseCase,
     IQueryHandler <GetFileForBookQuery, string> getFileUseCase)
 {
     _getBookBaseInfoUseCase        = getBookBaseInfoUseCase;
     _getBookInfoWithDetailsUseCase = getBookInfoWithDetailsUseCase;
     _getBooksBaseInfoUseCase       = getBooksBaseInfoUseCase;
     _addNewBookToStoreUseCase      = addNewBookToStoreUseCase;
     _storeFileUseCase = storeFileUseCase;
     _getFileUseCase   = getFileUseCase;
 }
Beispiel #18
0
 public ContactController(ICommandHandler <CreateContact> commandHandler,
                          ICommandHandler <DeleteContact> deleteCommandHandler,
                          ICommandHandler <AddContactInfo> addContactInfoCommandHandler,
                          ICommandHandler <DeleteContactInfo> deleteContactInfoCommandHandler,
                          IQueryHandler <GetContacts, IEnumerable <ContactDto> > queryHandler,
                          IQueryHandler <GetContactDetails, ContactDetailDto> contactDetailQueryHandler
                          )
 {
     _commandHandler                  = commandHandler;
     _deleteCommandHandler            = deleteCommandHandler;
     _addContactInfoCommandHandler    = addContactInfoCommandHandler;
     _deleteContactInfoCommandHandler = deleteContactInfoCommandHandler;
     _queryHandler = queryHandler;
     _contactDetailQueryHandler = contactDetailQueryHandler;
 }
Beispiel #19
0
        public MatchmakingHubClient(IQueryHandler<UserDto, GetUserByUserNameQuery> getUserByUserNameQueryHandler)
        {
            _getUserByUserNameQueryHandler = getUserByUserNameQueryHandler;
            _gameHub = GlobalHost.ConnectionManager.GetHubContext<GameHub>();

            string matchmakongServerUrl = ConfigurationManager.AppSettings["MatchmakingServerUrl"];
            string matchmakingServerHub = ConfigurationManager.AppSettings["MatchmakingServerHub"];

            var connection = new HubConnection(matchmakongServerUrl);
            MatchmakingServerHub = connection.CreateHubProxy(matchmakingServerHub);

            RegisterHandlers();

            connection.Start();
        }
Beispiel #20
0
        public async Task <int> CreateAsync(
            [FromBody] ChangeOrderDto dto,
            [FromServices] ICommandHandler <CreateOrderCommand> commandHandler,
            [FromServices] IQueryHandler <GetLastOrderIdQuery, int> queryHandler
            )
        {
            var command = new CreateOrderCommand {
                Dto = dto
            };
            await commandHandler.HandleAsync(command);

            var id = await queryHandler.HandleAsync(new GetLastOrderIdQuery());

            return(id);
        }
Beispiel #21
0
 public LocationService(
     IMapper mapper,
     IUnitOfWork unitOfWork,
     IRepository <Location> repository,
     IQueryHandler <Employee, LocationEmployeeModel>
     employeeQueryHandler,
     IQueryHandler <Location, NamedQueryModel> namedQueryHandler,
     ILogger <LocationService> logger = null)
     : base(mapper, unitOfWork, repository, logger)
 {
     _employeeQueryHandler = employeeQueryHandler
                             ?? throw new NullReferenceException();
     _namedQueryHandler = namedQueryHandler
                          ?? throw new NullReferenceException();
 }
Beispiel #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueReceiveMessages" /> class.
        /// </summary>
        /// <param name="workSubFactory">The work sub factory.</param>
        /// <param name="receiveMessage">The receive message.</param>
        /// <param name="handleMessage">The handle message.</param>
        /// <param name="cancelWork">The cancel work.</param>
        public RedisQueueReceiveMessages(IRedisQueueWorkSubFactory workSubFactory,
                                         IQueryHandler <ReceiveMessageQuery, RedisMessage> receiveMessage,
                                         ITransportHandleMessage handleMessage,
                                         IQueueCancelWork cancelWork)
        {
            Guard.NotNull(() => workSubFactory, workSubFactory);
            Guard.NotNull(() => receiveMessage, receiveMessage);
            Guard.NotNull(() => handleMessage, handleMessage);
            Guard.NotNull(() => cancelWork, cancelWork);

            _receiveMessage = receiveMessage;
            _handleMessage  = handleMessage;
            _cancelWork     = cancelWork;
            _workSubFactory = workSubFactory;
        }
Beispiel #23
0
        public IQueryHandler <TQuery, TResponse> ProvideHandler <TQuery, TResponse>()
        {
            Type responseType = typeof(TResponse);
            IQueryHandler <TQuery, TResponse> handler = null;

            if (!this._handlers.ContainsKey(responseType))
            {
                throw new ApplicationException($"Handler for query {responseType} is not registered");
            }
            Type handlerType = this._handlers[responseType];

            handler = (IQueryHandler <TQuery, TResponse>)Activator.CreateInstance(handlerType);

            return(handler);
        }
Beispiel #24
0
 public UserSessionService(ICommandHandler <UpsertUserSessionCommand, UpsertUserSessionCommandResponse> upsertUserSessionCommand,
                           IQueryHandler <GetUserSessionQuery, GetUserSessionQueryResponse> getUserSessionQuery,
                           ICommandHandler <DeleteUserSessionCommand, DeleteUserSessionCommandResponse> deleteUserSessionCommand,
                           IUserService userService,
                           UserIdentitySettings config,
                           IHttpContextAccessor httpContextAccessor
                           )
 {
     _upsertUserSessionCommand = upsertUserSessionCommand;
     _getUserSessionQuery      = getUserSessionQuery;
     _deleteUserSessionCommand = deleteUserSessionCommand;
     _userService            = userService;
     _userSessionExpiryHours = config.UserSessionExpiryHours <= 0 ? 24 : config.UserSessionExpiryHours;
     _httpContextAccessor    = httpContextAccessor;
 }
Beispiel #25
0
 public AnswerService(
     IQueryHandler <GetAnswer, Answer> getAnswer,
     IQueryHandler <GetAnswerGlobalMeta, AnswerGlobalMeta> getAnswerGlobalMeta,
     ICreateCommandHandler <CreateNewAnswer, Answer> createNewAnswer,
     ICommandHandler <UpdateAnswerMeta> updateAnswerMeta,
     ICommandHandler <UpdateAnswer> updateAnswer,
     IInternalQuestionMetaService internalMetaService)
 {
     _createNewAnswer     = createNewAnswer;
     _getAnswer           = getAnswer;
     _getAnswerGlobalMeta = getAnswerGlobalMeta;
     _updateAnswerMeta    = updateAnswerMeta;
     _updateAnswer        = updateAnswer;
     _internalMetaService = internalMetaService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReceiveMessage" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="receiveMessage">The receive message.</param>
        /// <param name="cancelToken">The cancel token.</param>
        /// <param name="receiveMessageAsync">The receive message asynchronous.</param>
        public ReceiveMessage(QueueConsumerConfiguration configuration,
                              IQueryHandler <ReceiveMessageQuery <IDbConnection, IDbTransaction>, IReceivedMessageInternal> receiveMessage,
                              IQueueCancelWork cancelToken,
                              IQueryHandler <ReceiveMessageQueryAsync <IDbConnection, IDbTransaction>, Task <IReceivedMessageInternal> > receiveMessageAsync)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => receiveMessage, receiveMessage);
            Guard.NotNull(() => cancelToken, cancelToken);
            Guard.NotNull(() => receiveMessageAsync, receiveMessageAsync);

            _configuration       = configuration;
            _receiveMessage      = receiveMessage;
            _cancelToken         = cancelToken;
            _receiveMessageAsync = receiveMessageAsync;
        }
Beispiel #27
0
 public PostGradeHandler(
     ILogger <PostGradeHandler> logger,
     IValidation <PostGradeRequestModel> validator,
     ICommandHandler <EvaluateStudentCommand> evaluateStudentCommandHandler,
     IQueryHandler <GetStudentByIdQuery, Student> getStudentByIdQueryHandler,
     IQueryHandler <GetTeacherByIdQuery, Teacher> getTeacherByIdQueryHandler,
     IQueryHandler <GetCourseByIdQuery, Course> getCourseByIdQueryHandler)
 {
     _logger    = logger;
     _validator = validator;
     _evaluateStudentCommandHandler = evaluateStudentCommandHandler;
     _getStudentByIdQueryHandler    = getStudentByIdQueryHandler;
     _getTeacherByIdQueryHandler    = getTeacherByIdQueryHandler;
     _getCourseByIdQueryHandler     = getCourseByIdQueryHandler;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetQueueOptionsQueryHandler{TTransportOptions}" /> class.
        /// </summary>
        /// <param name="serializer">The serializer.</param>
        /// <param name="tableExists">The table exists.</param>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="tableNameHelper">The table name helper.</param>
        public GetQueueOptionsQueryHandler(IInternalSerializer serializer,
                                           IQueryHandler <GetTableExistsQuery, bool> tableExists,
                                           LiteDbConnectionManager connectionInformation,
                                           TableNameHelper tableNameHelper)
        {
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => tableExists, tableExists);
            Guard.NotNull(() => connectionInformation, connectionInformation);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);

            _serializer            = serializer;
            _tableExists           = tableExists;
            _connectionInformation = connectionInformation;
            _tableNameHelper       = tableNameHelper;
        }
Beispiel #29
0
 public ImportController(
     ILogger <ImportController> logger,
     IQueryHandler <ContentTypeQuery, ContentType[]> contentTypeQueryHandler,
     IQueryHandler <ContentCollectionQuery, ContentCollection[]> contentCollectionQueryHandler,
     ICommandHandler <SaveContentCollectionCommand> saveContentCollectionCommand,
     IQueryHandler <ContentItemQuery, ContentItem[]> contentItemQueryHandler,
     ICommandHandler <SaveContentItemCommand> saveContentItemCommand)
 {
     _contentTypeQueryHandler       = contentTypeQueryHandler;
     _contentCollectionQueryHandler = contentCollectionQueryHandler;
     _saveContentCollectionCommand  = saveContentCollectionCommand;
     _contentItemQueryHandler       = contentItemQueryHandler;
     _saveContentItemCommand        = saveContentItemCommand;
     _logger = logger;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReceiveMessage" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="receiveMessage">The receive message.</param>
        /// <param name="cancelToken">The cancel token.</param>
        /// <param name="receiveMessageAsync">The receive message asynchronous.</param>
        public ReceiveMessage(QueueConsumerConfiguration configuration,
            IQueryHandler<ReceiveMessageQuery, IReceivedMessageInternal> receiveMessage,
            IQueueCancelWork cancelToken, 
            IQueryHandler<ReceiveMessageQueryAsync, Task<IReceivedMessageInternal>> receiveMessageAsync)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => receiveMessage, receiveMessage);
            Guard.NotNull(() => cancelToken, cancelToken);
            Guard.NotNull(() => receiveMessageAsync, receiveMessageAsync);

            _configuration = configuration;
            _receiveMessage = receiveMessage;
            _cancelToken = cancelToken;
            _receiveMessageAsync = receiveMessageAsync;
        }
 public RolesController(IRepository <Rol> repo,
                        IRepository <RolPagina> repo_option,
                        IRepository <Pagina> repo_Pagina,
                        IRepository <RolUser> repo_RolUser,
                        IQueryHandler <ListarRolesPorUsuarioParameter> handler_RolUser,
                        IQueryHandler <ListarTreeViewParameter> handler, IMapper mapper)
 {
     _repo_option     = repo_option;
     _repo_Pagina     = repo_Pagina;
     _repo_RolUser    = repo_RolUser;
     _hanlder_RolUser = handler_RolUser;
     _repo            = repo;
     _handler         = handler;
     _mapper          = mapper;
 }
Beispiel #32
0
 public ProfessorsService(
     IMapper <Professor, ProfessorResponseModel> professorsMapper,
     IQueryHandler <ProfessorByIdQuery, Professor> professorByIdHandler,
     ICommandHandler <DeleteEntityCommand, bool> deleteProfessorHandler,
     ICommandHandler <ProfessorCommand, Professor> createProfessorHandler,
     ICommandHandler <UpdateProfessorCommand, Professor> updateProfessorHandler,
     IQueryHandler <AllEntitiesQuery <Professor>, IEnumerable <Professor> > allProfessorsHandler)
 {
     this.professorsMapper       = professorsMapper;
     this.professorByIdHandler   = professorByIdHandler;
     this.createProfessorHandler = createProfessorHandler;
     this.deleteProfessorHandler = deleteProfessorHandler;
     this.updateProfessorHandler = updateProfessorHandler;
     this.allProfessorsHandler   = allProfessorsHandler;
 }
 public SaveOrderQueryHandler(IQueryHandler <GetCategoryByUrlCommand, CategoryDto> getCategoryByUrlQueryHandler,
                              IRemoteQuery <ListPaymentMethodsCommand, List <PaymentMethod> > listPaymentMethodsQuery,
                              IRemoteQuery <ListShippingMethodsCommand, List <ShippingMethod> > listShippingMethodsQuery,
                              IRemoteQuery <ListOrderStatusesCommand, List <OrderStatus> > listOrderStatusesQuery,
                              IRemoteQuery <GetOrderCommand, Order> getOrderQuery,
                              EkShopContext dbContext,
                              IWorkContext workContext)
 {
     _getCategoryByUrlQueryHandler = getCategoryByUrlQueryHandler;
     _listPaymentMethodsQuery      = listPaymentMethodsQuery;
     _listShippingMethodsQuery     = listShippingMethodsQuery;
     _listOrderStatusesQuery       = listOrderStatusesQuery;
     _getOrderQuery = getOrderQuery;
     _dbContext     = dbContext;
     _workContext   = workContext;
 }
Beispiel #34
0
 public ResultsModel(ApplicationDbContext context,
                     UserManager <IdentityUser> userManager,
                     IQueryHandler <ContestsUsersQuery, ContestsUsersQueryResult> contestsUsersQueryHandler,
                     IQueryHandler <TaskScoreQuery, TaskScoreQueryResult> taskScoreQueryHandler,
                     IQueryHandler <TestResultsQuery, TestResultsQueryResult> testResultsQueryHandler,
                     IQueryHandler <ContestScoreQuery, ContestScoreQueryResult> contestScoreQueryHandler,
                     IQueryHandler <NewestSolutionsQuery, NewestSolutionsResult> newestSolutionsQueryHandle)
 {
     _context     = context;
     _userManager = userManager;
     _contestsUsersQueryHandler   = contestsUsersQueryHandler;
     _taskScoreQueryHandler       = taskScoreQueryHandler;
     _testResultsQueryHandler     = testResultsQueryHandler;
     _contestScoreQueryHandler    = contestScoreQueryHandler;
     _newestSolutionsQueryHandler = newestSolutionsQueryHandle;
 }
        /// <summary>
        /// Traite la requête et retourne le résultat de cette requête.
        /// </summary>
        /// <typeparam name="TQuery">Type de la requête.</typeparam>
        /// <typeparam name="TResult">Type du résultat de la requête.</typeparam>
        /// <param name="query">Requête à traiter</param>
        /// <returns>le résultat de la requête.</returns>
        //[DebuggerStepThrough]
        public TResult Process <TQuery, TResult>(TQuery query) where TQuery : IQuery <TResult>
        {
            IQueryHandler <TQuery, TResult> handler = null;

            // Recherche de l'handler associé à la query.
            handler = DependencyFactory.Resolve <IQueryHandler <TQuery, TResult> >();

            // On lève une erreur si aucun handler a été trouvé.
            if (handler == null)
            {
                throw new Exception("Handler non trouvé");
            }

            // On appele le handler et on retourne le résultat de la commande.
            return(handler.Handle(query));
        }
Beispiel #36
0
        public IQueryHandler Create(Type handlerType)
        {
            if (handlerType == null)
            {
                throw new InvalidOperationException("handlerType cannot be null");
            }

            if (!typeof(IQueryHandler).IsAssignableFrom(handlerType))
            {
                throw new InvalidOperationException($"{handlerType.Name} must be an ICommandHandler");
            }

            IQueryHandler instance = (IQueryHandler)Activator.CreateInstance(handlerType);

            return(instance);
        }
 public ChaptersController(IMapper mapper,
                           ICommandHandler <CreateChapterCommand, ChapterDto> createChapterCommandHandler,
                           ICommandHandler <UpdateChapterCommand, ChapterDto> updateChapterCommandHandler,
                           ICommandHandler <DeleteChapterCommand, bool> deleteChapterCommandHandler,
                           IQueryHandler <GetCourseQuery, Course> getCourseQueryHandler,
                           IQueryHandler <GetChapterQuery, Chapter> getChapterQueryHandler,
                           IResponseHandler responseHandler)
 {
     this.mapper = mapper;
     this.createChapterCommandHandler = createChapterCommandHandler;
     this.updateChapterCommandHandler = updateChapterCommandHandler;
     this.deleteChapterCommandHandler = deleteChapterCommandHandler;
     this.getCourseQueryHandler       = getCourseQueryHandler;
     this.getChapterQueryHandler      = getChapterQueryHandler;
     this.responseHandler             = responseHandler;
 }
        public ProductController(IQueryHandler <RetrieveProductQuery, ProductDto> retrieveProductQueryHandler,
                                 ICommandHandler <AddProductCommand> addProductCommandHandler
                                 )
        {
            if (retrieveProductQueryHandler == null)
            {
                throw new ArgumentNullException("Retrieve product query handler cannot be passed null");
            }
            if (addProductCommandHandler == null)
            {
                throw new ArgumentNullException("Add product command handler cannot be passed null");
            }

            _retrieveProductQueryHandler = retrieveProductQueryHandler;
            _addProductCommandHandler    = addProductCommandHandler;
        }
Beispiel #39
0
 public NotificationUpDateStato(IHubContext <NotificationHub> notificationHubContext,
                                IQueryHandler <BoxRichiesteQuery, BoxRichiesteResult> boxRichiesteHandler,
                                IQueryHandler <SintesiRichiesteAssistenzaMarkerQuery, SintesiRichiesteAssistenzaMarkerResult> sintesiRichiesteAssistenzaMarkerHandler,
                                IQueryHandler <SintesiRichiesteAssistenzaQuery, SintesiRichiesteAssistenzaResult> sintesiRichiesteAssistenzaHandler,
                                IQueryHandler <BoxMezziQuery, BoxMezziResult> boxMezziHandler,
                                IQueryHandler <BoxPersonaleQuery, BoxPersonaleResult> boxPersonaleHandler,
                                IGetSintesiRichiestaAssistenzaByCodice getSintesiById)
 {
     _notificationHubContext = notificationHubContext;
     _boxRichiesteHandler    = boxRichiesteHandler;
     _sintesiRichiesteAssistenzaMarkerHandler = sintesiRichiesteAssistenzaMarkerHandler;
     _sintesiRichiesteAssistenzaHandler       = sintesiRichiesteAssistenzaHandler;
     _boxMezziHandler     = boxMezziHandler;
     _boxPersonaleHandler = boxPersonaleHandler;
     _getSintesiById      = getSintesiById;
 }
Beispiel #40
0
 public NotificationAddTrasferimento(IHubContext <NotificationHub> notificationHubContext,
                                     IQueryHandler <BoxRichiesteQuery, BoxRichiesteResult> boxRichiesteHandler,
                                     IQueryHandler <GetSintesiRichiestaAssistenzaQuery, GetSintesiRichiestaAssistenzaResult> getRichiesta,
                                     IGetAlberaturaUnitaOperative getAlberaturaUnitaOperative,
                                     IGetTrasferimenti getTrasferimenti,
                                     IGetUtenteById getUtenteById,
                                     IGetDistaccamentoByCodiceSede getSede)
 {
     _notificationHubContext = notificationHubContext;
     _boxRichiesteHandler    = boxRichiesteHandler;
     _getRichiesta           = getRichiesta;
     _getTrasferimenti       = getTrasferimenti;
     _getUtenteById          = getUtenteById;
     _getSede            = getSede;
     _getGerarchiaToSend = new GetGerarchiaToSend(getAlberaturaUnitaOperative);
 }
Beispiel #41
0
 public NotificationUpDateChiamata(IHubContext <NotificationHub> notificationHubContext,
                                   IQueryHandler <BoxRichiesteQuery, BoxRichiesteResult> boxRichiesteHandler,
                                   IQueryHandler <SintesiRichiesteAssistenzaMarkerQuery, SintesiRichiesteAssistenzaMarkerResult> sintesiRichiesteAssistenzaMarkerHandler,
                                   IQueryHandler <SintesiRichiesteAssistenzaQuery, SintesiRichiesteAssistenzaResult> sintesiRichiesteAssistenzaHandler,
                                   IGetRichiestaById getRichiestaById,
                                   IGetSintesiRichiestaAssistenzaByCodice getSintesiById,
                                   GetGerarchiaToSend getGerarchiaToSend)
 {
     _notificationHubContext = notificationHubContext;
     _boxRichiesteHandler    = boxRichiesteHandler;
     _sintesiRichiesteAssistenzaMarkerHandler = sintesiRichiesteAssistenzaMarkerHandler;
     _sintesiRichiesteAssistenzaHandler       = sintesiRichiesteAssistenzaHandler;
     _getRichiestaById   = getRichiestaById;
     _getSintesiById     = getSintesiById;
     _getGerarchiaToSend = getGerarchiaToSend;
 }
        public AddBitmapForDocumentToProcessHandler(
            IQueryHandler <GetDocumentToProcess, DocumentToProcess> getDocumentToProcess,
            IResourceCommandHandler <SavePageBitmapForDocumentToProcess, FileStorageRequestResult> persistImageCommand)
        {
            if (getDocumentToProcess == null)
            {
                throw new ArgumentNullException(nameof(getDocumentToProcess));
            }
            if (persistImageCommand == null)
            {
                throw new ArgumentNullException(nameof(persistImageCommand));
            }

            _saveImageCommand     = persistImageCommand;
            _getDocumentToProcess = getDocumentToProcess;
        }
Beispiel #43
0
 public SaveCategoryQueryHandler(IQueryHandler <GetInputFormCommand, InputFormDto> getInputFormQueryHandler,
                                 IQueryHandler <GetCategoryByUrlCommand, CategoryDto> getCategoryByUrlQueryHandler,
                                 IRemoteQuery <GetCategoryCommand, Category> categoryQuery,
                                 IRemoteQuery <ListCharacteristicsCommand, List <Characteristic> > listCharacteristicsQuery,
                                 IRemoteQuery <GetPhraseByValueCommand, Phrase> getPhraseByValueQuery,
                                 IRemoteQuery <SaveCategoryQueryCommand, Category> saveCategoryQuery,
                                 IClassifierStoresRepository classifierStoresRepository)
 {
     _getInputFormQueryHandler     = getInputFormQueryHandler;
     _getCategoryByUrlQueryHandler = getCategoryByUrlQueryHandler;
     _getCategoryQuery             = categoryQuery;
     _listCharacteristicsQuery     = listCharacteristicsQuery;
     _getPhraseByValueQuery        = getPhraseByValueQuery;
     _saveCategoryQuery            = saveCategoryQuery;
     _classifierStoresRepository   = classifierStoresRepository;
 }
        private void CacheHandler(IQueryHandler handler)
        {
            Contract.Requires(handler != null);
            Contract.Ensures((handler.Reusable == false && GetCachedHandler(handler.GetType()) == null) ||
                             (handler.Reusable && _handlers[handler.GetType()] != null));

            // if handler is reusable, cache
            if (handler.Reusable)
            {
                _handlers[handler.GetType()] = handler;
            }
            else
            {
                Contract.Assume(GetCachedHandler(handler.GetType()) == null);
            }
        }
 public NotificationConfermaPartenze(IHubContext <NotificationHub> notificationHubContext,
                                     IQueryHandler <BoxRichiesteQuery, BoxRichiesteResult> boxRichiestehandler,
                                     IQueryHandler <BoxMezziQuery, BoxMezziResult> boxMezzihandler,
                                     IQueryHandler <BoxPersonaleQuery, BoxPersonaleResult> boxPersonalehandler,
                                     IQueryHandler <SintesiRichiesteAssistenzaMarkerQuery, SintesiRichiesteAssistenzaMarkerResult> sintesiRichiesteAssistenzaMarkerhandler,
                                     IMapper mapper,
                                     IQueryHandler <SintesiRichiesteAssistenzaQuery, SintesiRichiesteAssistenzaResult> sintesiRichiesteHandler)
 {
     _notificationHubContext = notificationHubContext;
     _boxRichiestehandler    = boxRichiestehandler;
     _boxMezzihandler        = boxMezzihandler;
     _boxPersonalehandler    = boxPersonalehandler;
     _sintesiRichiesteAssistenzaMarkerhandler = sintesiRichiesteAssistenzaMarkerhandler;
     _mapper = mapper;
     _sintesiRichiesteHandler = sintesiRichiesteHandler;
 }
        public HearingsController(IQueryHandler queryHandler, ICommandHandler commandHandler,
                                  IEventPublisher eventPublisher,
                                  IRandomGenerator randomGenerator,
                                  IOptions <KinlyConfiguration> kinlyConfiguration,
                                  IHearingService hearingService,
                                  ILogger logger)
        {
            _queryHandler    = queryHandler;
            _commandHandler  = commandHandler;
            _eventPublisher  = eventPublisher;
            _randomGenerator = randomGenerator;
            _hearingService  = hearingService;
            _logger          = logger;

            _kinlyConfiguration = kinlyConfiguration.Value;
        }
 public static IQueryHandler <TQuery, TResult> AsLoggable <TQuery, TResult>(
     this IQueryHandler <TQuery, TResult> queryHandler, params LoggingData[] constantLoggingData)
 {
     return
         (new LoggingAwareQueryHandler <TQuery, TResult>(
              queryHandler,
              new ConsoleLogger(),
              new CompositeObjectLoggingDataExtractor(
                  new QueryNameObjectLoggingDataExtractor(),
                  new ObjectMembersLoggingDataExtractor(new LogCountAttributeBasedLoggingDataExtractor()),
                  new ObjectMembersLoggingDataExtractor(new LogAttributeBasedLoggingDataExtractor()),
                  new ConstantObjectLoggingDataExtractor(constantLoggingData)),
              new CompositeObjectLoggingDataExtractor(
                  new ObjectMembersLoggingDataExtractor(new LogCountAttributeBasedLoggingDataExtractor()),
                  new ObjectMembersLoggingDataExtractor(new LogAttributeBasedLoggingDataExtractor()))));
 }
Beispiel #48
0
 public NotificationModificaPartenza(IHubContext <NotificationHub> notificationHubContext,
                                     IGetAlberaturaUnitaOperative getAlberaturaUnitaOperative,
                                     IQueryHandler <BoxRichiesteQuery, BoxRichiesteResult> boxRichiesteHandler,
                                     IQueryHandler <BoxMezziQuery, BoxMezziResult> boxMezziHandler,
                                     IQueryHandler <BoxPersonaleQuery, BoxPersonaleResult> boxPersonaleHandler,
                                     IMapper mapper,
                                     IGetTipologieByCodice getTipologieByCodice,
                                     IGetUtenteById getUtenteById)
 {
     _getGerarchiaToSend     = new GetGerarchiaToSend(getAlberaturaUnitaOperative);
     _mapperSintesi          = new MapperRichiestaAssistenzaSuSintesi(mapper, getTipologieByCodice, getUtenteById);
     _notificationHubContext = notificationHubContext;
     _boxMezziHandler        = boxMezziHandler;
     _boxPersonaleHandler    = boxPersonaleHandler;
     _boxRichiesteHandler    = boxRichiesteHandler;
 }
 public ApplicationController(IQueryHandler<ListApplications, IEnumerable<UserOrganizationApplication>> getApplications,
     IQueryHandler<ListOrganizations, IEnumerable<Organization>> listOrganizations,
     ICommandHandler<CreateApplication, UserOrganizationApplication> createApplication,
     IQueryHandler<GetApplication, UserOrganizationApplication> getApplication,
     IQueryHandler<ListApplicationKeys, IEnumerable<OrganizationApplicationKey>> listApplicationKeys,
     ICommandHandler<CreateApplicationKey, OrganizationApplicationKey> createApplicationKey,
     IQueryHandler<IListApplicationCodeFeatures, IEnumerable<ICodeFeatureState>> listApplicationCodeFeatures, ICommandHandler<IUpdateApplicationCodeFeatureState> updateApplicationCodeFeatureState)
 {
     _getApplications = getApplications;
     _listOrganizations = listOrganizations;
     _createApplication = createApplication;
     _getApplication = getApplication;
     _listApplicationKeys = listApplicationKeys;
     _createApplicationKey = createApplicationKey;
     _listApplicationCodeFeatures = listApplicationCodeFeatures;
     _updateApplicationCodeFeatureState = updateApplicationCodeFeatureState;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueStatusProvider" /> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information.</param>
        /// <param name="getTimeFactory">The get time factory.</param>
        /// <param name="pendingQueryHandler">The pending query handler.</param>
        /// <param name="pendingDelayedQueryHandler">The pending delayed query handler.</param>
        /// <param name="workingCountQueryHandler">The working count query handler.</param>
        /// <param name="errorCountQueryHandler">The error count query handler.</param>
        public RedisQueueStatusProvider(IConnectionInformation connectionInformation,
            IGetTimeFactory getTimeFactory,
            IQueryHandler<GetPendingCountQuery, long> pendingQueryHandler,
            IQueryHandler<GetPendingDelayedCountQuery, long> pendingDelayedQueryHandler,
            IQueryHandler<GetWorkingCountQuery, long> workingCountQueryHandler,
            IQueryHandler<GetErrorCountQuery, long> errorCountQueryHandler) : base(connectionInformation, getTimeFactory)
        {
            Guard.NotNull(() => pendingQueryHandler, pendingQueryHandler);
            Guard.NotNull(() => pendingDelayedQueryHandler, pendingDelayedQueryHandler);
            Guard.NotNull(() => workingCountQueryHandler, workingCountQueryHandler);
            Guard.NotNull(() => errorCountQueryHandler, errorCountQueryHandler);

            _pendingQueryHandler = pendingQueryHandler;
            _pendingDelayedQueryHandler = pendingDelayedQueryHandler;
            _workingQueryHandler = workingCountQueryHandler;
            _errorQueryHandler = errorCountQueryHandler;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqliteJobTableCreation" /> class.
        /// </summary>
        /// <param name="queryTableExists">The query table exists.</param>
        /// <param name="createSchema">The create schema.</param>
        /// <param name="createCommand">The create command.</param>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="tableNameHelper">The table name helper.</param>
        public SqliteJobTableCreation(IQueryHandler<GetTableExistsQuery, bool> queryTableExists,
            SqliteJobSchema createSchema,
            ICommandHandlerWithOutput<CreateJobTablesCommand, QueueCreationResult> createCommand,
            IConnectionInformation connectionInfo,
            TableNameHelper tableNameHelper
            )
        {
            Guard.NotNull(() => createSchema, createSchema);
            Guard.NotNull(() => queryTableExists, queryTableExists);
            Guard.NotNull(() => createCommand, createCommand);
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => tableNameHelper, tableNameHelper);

            _createSchema = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand = createCommand;
            _connection = connectionInfo;
            _tableNameHelper = tableNameHelper;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqLiteMessageQueueReceiveErrorMessage" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="queryErrorRetryCount">The query error retry count.</param>
        /// <param name="commandSetErrorCount">The command set error count.</param>
        /// <param name="commandMoveRecord">The command move record.</param>
        /// <param name="log">The log.</param>
        /// <param name="headers">The headers.</param>
        public SqLiteMessageQueueReceiveErrorMessage(QueueConsumerConfiguration configuration,
            IQueryHandler<GetErrorRetryCountQuery, int> queryErrorRetryCount, ICommandHandler<SetErrorCountCommand> commandSetErrorCount,
            ICommandHandler<MoveRecordToErrorQueueCommand> commandMoveRecord,
            ILogFactory log, 
            SqlHeaders headers)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => queryErrorRetryCount, queryErrorRetryCount);
            Guard.NotNull(() => commandSetErrorCount, commandSetErrorCount);
            Guard.NotNull(() => commandMoveRecord, commandMoveRecord);
            Guard.NotNull(() => log, log);

            _configuration = configuration;
            _queryErrorRetryCount = queryErrorRetryCount;
            _commandSetErrorCount = commandSetErrorCount;
            _commandMoveRecord = commandMoveRecord;
            _log = log.Create();
            _headers = headers;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueReceiveMessages" /> class.
        /// </summary>
        /// <param name="workSubFactory">The work sub factory.</param>
        /// <param name="receiveMessage">The receive message.</param>
        /// <param name="handleMessage">The handle message.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="cancelWork">The cancel work.</param>
        /// <param name="receiveMessageAsync">The receive message asynchronous.</param>
        public RedisQueueReceiveMessages(IRedisQueueWorkSubFactory workSubFactory,
            IQueryHandler<ReceiveMessageQuery, RedisMessage> receiveMessage, 
            HandleMessage handleMessage, 
            IHeaders headers,
            IQueueCancelWork cancelWork, IQueryHandler<ReceiveMessageQueryAsync, Task<RedisMessage>> receiveMessageAsync)
        {
            Guard.NotNull(() => workSubFactory, workSubFactory);
            Guard.NotNull(() => receiveMessage, receiveMessage);
            Guard.NotNull(() => handleMessage, handleMessage);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => cancelWork, cancelWork);
            Guard.NotNull(() => receiveMessageAsync, receiveMessageAsync);

            _receiveMessage = receiveMessage;
            _handleMessage = handleMessage;
            _headers = headers;
            _cancelWork = cancelWork;
            _receiveMessageAsync = receiveMessageAsync;
            _workSubFactory = workSubFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueReceiveMessagesError"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="queryGetMetaData">The query get meta data.</param>
        /// <param name="saveMetaData">The save meta data.</param>
        /// <param name="commandMoveRecord">The command move record.</param>
        /// <param name="log">The log.</param>
        /// <param name="headers">The headers.</param>
        public RedisQueueReceiveMessagesError(
            QueueConsumerConfiguration configuration,
            IQueryHandler<GetMetaDataQuery, RedisMetaData> queryGetMetaData,
            ICommandHandler<SaveMetaDataCommand> saveMetaData,
            ICommandHandler<MoveRecordToErrorQueueCommand> commandMoveRecord,
            ILogFactory log,
            RedisHeaders headers)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => queryGetMetaData, queryGetMetaData);
            Guard.NotNull(() => saveMetaData, saveMetaData);
            Guard.NotNull(() => commandMoveRecord, commandMoveRecord);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => headers, headers);

            _configuration = configuration;
            _queryGetMetaData = queryGetMetaData;
            _saveMetaData = saveMetaData;
            _commandMoveRecord = commandMoveRecord;
            _log = log.Create();
            _headers = headers;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerMessageQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="queryTableExists">The query table exists.</param>
        /// <param name="options">The options.</param>
        /// <param name="createSchema">The create schema.</param>
        /// <param name="createCommand">The create command.</param>
        /// <param name="deleteCommand">The delete command.</param>
        /// <param name="creationScope">The creation scope.</param>
        public SqlServerMessageQueueCreation(IConnectionInformation connectionInfo,
            IQueryHandler<GetTableExistsQuery, bool> queryTableExists,
            ISqlServerMessageQueueTransportOptionsFactory options, 
            SqlServerMessageQueueSchema createSchema,
            ICommandHandlerWithOutput<CreateQueueTablesAndSaveConfigurationCommand, QueueCreationResult> createCommand,
            ICommandHandlerWithOutput<DeleteQueueTablesCommand, QueueRemoveResult> deleteCommand,
            ICreationScope creationScope
            )
        {
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => createSchema, createSchema);
            Guard.NotNull(() => queryTableExists, queryTableExists);
            Guard.NotNull(() => createCommand, createCommand);
            Guard.NotNull(() => deleteCommand, deleteCommand);
            Guard.NotNull(() => creationScope, creationScope);

            _options = new Lazy<SqlServerMessageQueueTransportOptions>(options.Create);
            _createSchema = createSchema;
            _queryTableExists = queryTableExists;
            _createCommand = createCommand;
            _deleteCommand = deleteCommand;
            ConnectionInfo = connectionInfo;
            Scope = creationScope;
        }
        public void Before_each_test()
        {
            NHibernateConfig.ConnectionString = TestBootstrapper.ConnectionString;
            using (session = NHibernateConfig.SessionFactory.OpenSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    SaveNewTag("alpha");
                    SaveNewTag("bravo");

                    SaveNewTask("alpha");
                    SaveNewTask("alpha");
                    SaveNewTask("alpha");
                    SaveNewTask("bravo");
                    SaveNewTask("bravo");

                    transaction.Commit();
                }
            }

            session = NHibernateConfig.SessionFactory.OpenSession();
            queryHandler = new TasksByTagQueryHandler(session);
            query = new TasksByTagQuery();
        }
 public PlaylistItemsService()
 {
     _playlistItemsQueryHandler = new PlaylistItemsQueryHandler();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SqliteJobSchedulerLastKnownEvent" /> class.
 /// </summary>
 /// <param name="queryGetJobTime">The query get job time.</param>
 public SqliteJobSchedulerLastKnownEvent(IQueryHandler<GetJobLastKnownEventQuery, DateTimeOffset> queryGetJobTime)
 {
     _queryGetJobTime = queryGetJobTime;
 }
Beispiel #59
0
 public VideosService()
 {
     _videosQueryHandler = new VideosQueryHandler();
 }
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="innerHandler">Inner Handler of this Server.</param>
 public ServerQueryRemotingHandlerSql(IQueryHandler innerHandler)
     : base(innerHandler)
 {
 }