public RegexRoute(Regex expression, RegexRouteHandler handler, object defaults) { Handler = handler; Expression = expression; DefaultGroups = new Dictionary<string, string>(); if (defaults != null) { var properties = defaults.GetType().GetProperties(); foreach (var prop in properties) DefaultGroups[prop.Name] = Convert.ToString(prop.GetValue(defaults, null)); } }
public RegexRoute(string expression, RegexRouteHandler handler, object defaults) : this(new Regex("^" + expression + "/?$", RegexOptions.Compiled), handler, defaults) { }
public RegexRoute(Regex expression, RegexRouteHandler handler) : this(expression, handler, null) { }
public RegexRoute(string expression, RegexRouteHandler handler) : this(new Regex("^" + expression + "/?$", RegexOptions.Compiled), handler, null) { }