Exposes a fluent API with chainable methods for configuring a CanonicalizeRoute.
示例#1
0
 /// <summary>
 /// Adds <see cref="Strategies.TrailingSlashStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder TrailingSlash(this CanonicalizeRouteBuilder builder)
 {
     return(builder.Strategy(new TrailingSlashStrategy()));
 }
示例#2
0
 /// <summary>
 /// Adds <see cref="Strategies.NoWwwStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Www(this CanonicalizeRouteBuilder builder)
 {
     return(builder.Strategy(new WwwStrategy()));
 }
示例#3
0
 /// <summary>
 /// Adds <see cref="Strategies.PatternStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <param name="regex">The regular expression applied to the path.</param>
 /// <param name="replacement">Replacement string applied on match.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Pattern(this CanonicalizeRouteBuilder builder, string regex, string replacement)
 {
     return(builder.Strategy(new PatternStrategy(regex, replacement)));
 }
示例#4
0
 /// <summary>
 /// Adds <see cref="Strategies.MapStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <param name="dictionary">Mapping between old paths (keys) and new paths (values).</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Map(this CanonicalizeRouteBuilder builder, IDictionary <string, string> dictionary)
 {
     return(builder.Strategy(new MapStrategy(dictionary)));
 }
示例#5
0
 /// <summary>
 /// Adds <see cref="Strategies.LowercaseStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Lowercase(this CanonicalizeRouteBuilder builder)
 {
     return(builder.Strategy(new LowercaseStrategy()));
 }
示例#6
0
 /// <summary>
 /// Adds <see cref="Strategies.HostStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <param name="host">Canonical DNS host name or IP address.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Host(this CanonicalizeRouteBuilder builder, string host)
 {
     return(builder.Strategy(new HostStrategy(host)));
 }
示例#7
0
 /// <summary>
 /// Adds a <see cref="Strategies.CustomStrategy"/> to the strategy collection.
 /// </summary>
 /// <param name="builder">Reponsible for building the <see cref="CanonicalizeRoute"/>.</param>
 /// <param name="action">The canonicalization action to be applied to the URL.</param>
 /// <returns>itself, allowing additional method calls to be chained.</returns>
 public static CanonicalizeRouteBuilder Custom(this CanonicalizeRouteBuilder builder, Action <UriBuilder> action)
 {
     return(builder.Strategy(new CustomStrategy(action)));
 }