public static IApplicationBuilder UseImgurAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] Action <ImgurAuthenticationOptions> configuration) { var options = new ImgurAuthenticationOptions(); configuration(options); return(app.UseImgurAuthentication(options)); }
/// <summary> /// Adds the <see cref="ImgurAuthenticationMiddleware"/> middleware to the specified /// <see cref="IApplicationBuilder"/>, which enables Imgur authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="options">A <see cref="ImgurAuthenticationOptions"/> that specifies options for the middleware.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseImgurAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] ImgurAuthenticationOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <ImgurAuthenticationMiddleware>(Options.Create(options))); }
/// <summary> /// Adds the <see cref="ImgurAuthenticationMiddleware"/> middleware to the specified /// <see cref="IApplicationBuilder"/>, which enables Imgur authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="configuration">An action delegate to configure the provided <see cref="ImgurAuthenticationOptions"/>.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseImgurAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] Action <ImgurAuthenticationOptions> configuration) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } var options = new ImgurAuthenticationOptions(); configuration(options); return(app.UseMiddleware <ImgurAuthenticationMiddleware>(Options.Create(options))); }
/// <summary>Configures the <see cref="IAppBuilder"/> to use <see cref="ImgurAuthenticationMiddleware"/> to authenticate user.</summary> /// <param name="appBuilder">The OWIN <see cref="IAppBuilder"/> to be configured.</param> /// <param name="options">The <see cref="ImgurAuthenticationOptions"/> with the settings to be used by the <see cref="ImgurAuthenticationMiddleware"/>.</param> /// <returns>The configured <see cref="IAppBuilder"/>.</returns> public static IAppBuilder UseImgurAuthentication(this IAppBuilder appBuilder, ImgurAuthenticationOptions options) { return appBuilder.Use<ImgurAuthenticationMiddleware>(appBuilder, options); }
public static IApplicationBuilder UseImgurAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] ImgurAuthenticationOptions options) { return(app.UseMiddleware <ImgurAuthenticationMiddleware>(options)); }
/// <summary>Configures the <see cref="IAppBuilder"/> to use <see cref="ImgurAuthenticationMiddleware"/> to authenticate user.</summary> /// <param name="appBuilder">The OWIN <see cref="IAppBuilder"/> to be configured.</param> /// <param name="options">The <see cref="ImgurAuthenticationOptions"/> with the settings to be used by the <see cref="ImgurAuthenticationMiddleware"/>.</param> /// <returns>The configured <see cref="IAppBuilder"/>.</returns> public static IAppBuilder UseImgurAuthentication(this IAppBuilder appBuilder, ImgurAuthenticationOptions options) { return(appBuilder.Use <ImgurAuthenticationMiddleware>(appBuilder, options)); }