/// <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); }
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(); }
/// <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(); }
/// <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(); }
/// <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(); }