public static IApplicationBuilder UseWeiBoAuthentication(this IApplicationBuilder app, Action <WeiBoOptions> configureOptions) { if (app == null) { throw new ArgumentNullException(nameof(app)); } var options = new WeiBoOptions(); configureOptions?.Invoke(options); return(app.UseWeiBoAuthentication(options)); }
public static IApplicationBuilder UseWeiBoAuthentication(this IApplicationBuilder app, WeiBoOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <WeiBoMiddleware>(options)); }