Esempio n. 1
0
        /// <summary>
        /// Adds Nancy to the OWIN pipeline.
        /// </summary>
        /// <param name="builder">The application builder.</param>
        /// <param name="options">The Nancy options.</param>
        /// <returns>IAppBuilder.</returns>
        public static IAppBuilder UseNancy(this IAppBuilder builder, NancyOptions options = null)
        {
            NancyOptions nancyOptions = options ?? new NancyOptions();

            AppBuilderExtensions.HookDisposal(builder, nancyOptions);
            return(builder.Use(NancyMiddleware.UseNancy(nancyOptions), new object[0]));
        }
Esempio n. 2
0
        public static IAppBuilder UseNancy(this IAppBuilder app, IApplication application)
        {
            Check.NotNull(app, nameof(app));
            Check.NotNull(application, nameof(application));

            return(app.Use(NancyMiddleware.Create(application)));
        }
        /// <summary>
        /// Adds Nancy to the OWIN pipeline.
        /// </summary>
        /// <param name="builder">The application builder delegate.</param>
        /// <param name="options">The Nancy options.</param>
        /// <returns>The application builder delegate.</returns>
        public static Action <MidFunc> UseNancy(this Action <MidFunc> builder, NancyOptions options = null)
        {
            var nancyOptions = options ?? new NancyOptions();

            builder(NancyMiddleware.UseNancy(nancyOptions).Invoke);

            return(builder);
        }