コード例 #1
0
ファイル: QueryCoordinator.cs プロジェクト: jarlef/Bifrost
        /// <summary>
        /// Initializes a new instance of <see cref="QueryCoordinator"/>
        /// </summary>
        /// <param name="typeDiscoverer"><see cref="ITypeDiscoverer"/> to use for discovering <see cref="IQueryProviderFor{T}"/> implementations</param>
        /// <param name="container"><see cref="IContainer"/> for getting instances of <see cref="IQueryProviderFor{T}">query providers</see></param>
        /// <param name="fetchingSecurityManager"><see cref="IFetchingSecurityManager"/> to use for securing <see cref="IQuery">queries</see></param>
        /// <param name="filters"><see cref="IReadModelFilters">Filters</see> used to filter any of the read models coming back after a query</param>
        public QueryCoordinator(ITypeDiscoverer typeDiscoverer, IContainer container, IFetchingSecurityManager fetchingSecurityManager, IReadModelFilters filters)
        {
            _container = container;
            _filters = filters;
            _fetchingSecurityManager = fetchingSecurityManager;
            var queryTypes = typeDiscoverer.FindMultiple(typeof(IQueryProviderFor<>));

            _queryProviderTypesPerTargetType = queryTypes.Select(t => new { 
                TargetType = GetQueryTypeFrom(t), 
                QueryProviderType = t }).ToDictionary(t => t.TargetType, t => t.QueryProviderType);
        }
コード例 #2
0
        public ReadModelService(ITypeDiscoverer typeDiscoverer, IContainer container, IFetchingSecurityManager fetchingSecurityManager, IReadModelFilters readModelFilters)
        {
            _typeDiscoverer          = typeDiscoverer;
            _container               = container;
            _fetchingSecurityManager = fetchingSecurityManager;
            _readModelFilters        = readModelFilters;

            _authorizeMethod = fetchingSecurityManager.GetType().GetMethods()
                               .Where(m =>
                                      m.Name == "Authorize" &&
                                      m.GetParameters()[0].ParameterType.Name.StartsWith("IReadModelOf")).Single();
        }
コード例 #3
0
ファイル: ReadModelService.cs プロジェクト: jarlef/Bifrost
        public ReadModelService(ITypeDiscoverer typeDiscoverer, IContainer container, IFetchingSecurityManager fetchingSecurityManager, IReadModelFilters readModelFilters)
        {
            _typeDiscoverer = typeDiscoverer;
            _container = container;
            _fetchingSecurityManager = fetchingSecurityManager;
            _readModelFilters = readModelFilters;

            _authorizeMethod = fetchingSecurityManager.GetType().GetMethods()
                .Where(m =>
                    m.Name == "Authorize" &&
                    m.GetParameters()[0].ParameterType.Name.StartsWith("IReadModelOf")).Single();
        }
コード例 #4
0
ファイル: QueryCoordinator.cs プロジェクト: LenFon/Bifrost
 /// <summary>
 /// Initializes a new instance of <see cref="QueryCoordinator"/>
 /// </summary>
 /// <param name="typeDiscoverer"><see cref="ITypeDiscoverer"/> to use for discovering <see cref="IQueryProviderFor{T}"/> implementations</param>
 /// <param name="container"><see cref="IContainer"/> for getting instances of <see cref="IQueryProviderFor{T}">query providers</see></param>
 /// <param name="fetchingSecurityManager"><see cref="IFetchingSecurityManager"/> to use for securing <see cref="IQuery">queries</see></param>
 /// <param name="validator"><see cref="IQueryValidator"/> to use for validating <see cref="IQuery">queries</see></param>
 /// <param name="filters"><see cref="IReadModelFilters">Filters</see> used to filter any of the read models coming back after a query</param>
 public QueryCoordinator(
     ITypeDiscoverer typeDiscoverer, 
     IContainer container, 
     IFetchingSecurityManager fetchingSecurityManager,
     IQueryValidator validator,
     IReadModelFilters filters)
 {
     _typeDiscoverer = typeDiscoverer;
     _container = container;
     _validator = validator;
     _filters = filters;
     _fetchingSecurityManager = fetchingSecurityManager;
     DiscoverQueryTypesPerTargetType();
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="QueryCoordinator"/>
 /// </summary>
 /// <param name="typeFinder"><see cref="ITypeFinder"/> to use for discovering <see cref="IQueryProviderFor{T}"/> implementations</param>
 /// <param name="container"><see cref="IContainer"/> for getting instances of <see cref="IQueryProviderFor{T}">query providers</see></param>
 /// <param name="fetchingSecurityManager"><see cref="IFetchingSecurityManager"/> to use for securing <see cref="IQuery">queries</see></param>
 /// <param name="validator"><see cref="IQueryValidator"/> to use for validating <see cref="IQuery">queries</see></param>
 /// <param name="filters"><see cref="IReadModelFilters">Filters</see> used to filter any of the read models coming back after a query</param>
 public QueryCoordinator(
     ITypeFinder typeFinder,
     IContainer container,
     IFetchingSecurityManager fetchingSecurityManager,
     IQueryValidator validator,
     IReadModelFilters filters)
 {
     _typeFinder = typeFinder;
     _container  = container;
     _fetchingSecurityManager = fetchingSecurityManager;
     _validator = validator;
     _filters   = filters;
     DiscoverQueryTypesPerTargetType();
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of <see cref="QueryCoordinator"/>
 /// </summary>
 /// <param name="typeDiscoverer"><see cref="ITypeDiscoverer"/> to use for discovering <see cref="IQueryProviderFor{T}"/> implementations</param>
 /// <param name="container"><see cref="IContainer"/> for getting instances of <see cref="IQueryProviderFor{T}">query providers</see></param>
 /// <param name="fetchingSecurityManager"><see cref="IFetchingSecurityManager"/> to use for securing <see cref="IQuery">queries</see></param>
 /// <param name="validator"><see cref="IQueryValidator"/> to use for validating <see cref="IQuery">queries</see></param>
 /// <param name="filters"><see cref="IReadModelFilters">Filters</see> used to filter any of the read models coming back after a query</param>
 /// <param name="exceptionPublisher">An <see cref="IExceptionPublisher"/> to send exceptions to</param>
 public QueryCoordinator(
     ITypeDiscoverer typeDiscoverer,
     IContainer container,
     IFetchingSecurityManager fetchingSecurityManager,
     IQueryValidator validator,
     IReadModelFilters filters,
     IExceptionPublisher exceptionPublisher)
 {
     _typeDiscoverer          = typeDiscoverer;
     _container               = container;
     _fetchingSecurityManager = fetchingSecurityManager;
     _validator               = validator;
     _filters            = filters;
     _exceptionPublisher = exceptionPublisher;
     DiscoverQueryTypesPerTargetType();
 }