using System; namespace EmbedIO.Utilities { partial class Validate { /// /// Ensures that the value of an argument is a valid route. /// /// The name of the argument to validate. /// The value to validate. /// if the argument must be a base route; /// if the argument must be a non-base route. /// , if it is a valid route. /// is . /// /// is empty. /// - or - /// does not start with a slash (/) character. /// - or - /// does not comply with route syntax. /// /// public static string Route(string argumentName, string value, bool isBaseRoute) { var exception = Routing.Route.ValidateInternal(argumentName, value, isBaseRoute); if (exception != null) throw exception; return Utilities.UrlPath.UnsafeNormalize(value, isBaseRoute); } } }