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