Ejemplo n.º 1
0
        /// <summary>
        /// Configure the API HTTP factory for the solution.
        /// </summary>
        /// <param name="builder">The dependency builder.</param>
        /// <param name="useIocHttpHandlerFactory">Specify if to use the <see cref="DependencyApiHttpFactoryHandler"/>. If false, the default factory will be used, see <see cref="DefaultHttpHandlerFactory"/>.
        /// This factory uses runtime activation to create the handlers, <seealso cref="Runtime.Create"/>.
        /// </param>
        /// <returns></returns>
        public static IDependencyBuilder ConfigureHttp(this IDependencyBuilder builder, bool useIocHttpHandlerFactory)
        {
            IApiHttpHandlerFactory handlerFactory = useIocHttpHandlerFactory ? new DependencyApiHttpFactoryHandler() : new DefaultHttpHandlerFactory(Create.Instance);

            return(builder.ConfigureHttp(handlerFactory));
        }