public bool AddRule(IRewriteRule rule) { if (rule == null) throw new ArgumentNullException("rule"); return this.rules.Add(rule); }
/// <inheritdoc /> public void AddRewriteRule(IRewriteRule rule) { _rewriteRules.Add(rule); }
/// <summary> /// Add a rewrite rule and configure them in the next constructing pipeline. /// </summary> /// <param name="builder">The <see cref="IHostBuilder"/></param> /// <param name="rewriteRule">The <see cref="IRewriteRule"/></param> /// <returns>The <see cref="IHostBuilder"/></returns> public static IHostBuilder AddRewriteRule(this IHostBuilder builder, IRewriteRule rewriteRule) { builder.ConfigureServices(services => services.AddSingleton(rewriteRule)); return(builder); }