コード例 #1
0
        /// <summary>
        /// Gets the query handlers.
        /// </summary>
        /// <param name="queryContract">The query contract.</param>
        /// <param name="commandContract">The command contract.</param>
        /// <param name="rootHandler">The root handler.</param>
        /// <returns>An array of query handlers.</returns>
        public IQueryHandler[] GetQueryHandlers(
            IQueryContract queryContract,
            ICommandContract commandContract,
            IQueryHandler rootHandler)
        {
            if (this.queryHandlers != null)
            {
                return(this.queryHandlers.ToArray());
            }

            if (this.serverServiceTypeProvider == null)
            {
                this.serverServiceTypeProvider = ServiceTypeProvider.Instance;
            }

            var queryHandlerCollectionFactory = this.serverServiceTypeProvider.QueryHandlerCollectionFactory;

            this.queryHandlers = queryHandlerCollectionFactory.Create(
                queryContract,
                commandContract,
                rootHandler);

            return(this.queryHandlers.ToArray());
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceServiceBootstrapper" /> class.
 /// </summary>
 /// <param name="serverServiceTypeProvider">The server service type provider.</param>
 internal DeviceServiceBootstrapper(IServerServiceTypeProvider serverServiceTypeProvider)
 {
     this.serverServiceTypeProvider = serverServiceTypeProvider;
 }