Nancy.RouteHelpers/RouteParameters.cs
/// <summary>
/// Creates a route that will accept a string but the URL doesn't always have to contain one, for example, /products OR /products/mac. NOTE: Do not use a / in your route before using this method as one is included
/// </summary>
/// <param name="NamedGroup">The name of the parameter in the route</param>
/// <returns></returns>
Creates a route that will accept a string but the URL doesn't always have to contain one, for example, /products OR /products/mac. NOTE: Do not use a / in your route before using this method as one is included
Creates a route that will accept a string but the URL doesn ' t always have to contain one for example / products OR / products / mac . NOTE : Do not use a / in your route before using this method as one is included
public RouteParameters AnyStringOptional(string NamedGroup)
        {
            RouteBuilder.Append(@"/?(?<" + NamedGroup + @">[\S]*)");
            return this;
        }
public RouteParameters AnyStringOptional ( string NamedGroup ) { RouteBuilder . Append ( @"/?(?<" + NamedGroup + @">[\S]*)" ) ; return this ; }
Creates a route that will accept a string but the URL doesn't always have to contain one, for example, /products OR /products/mac.
Creates a route that will accept a string but the URL doesn ' t always have to contain one for example / products OR / products / mac .
None
NamedGroup
string
The name of the parameter in the route
The name of the parameter in the route