public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            route.ResolveRelativeUrlsUsingString(_relativeUrl);
        }
Example #2
0
        public void Map(Type type, MethodInfo method, Routing.Route route, IContainer container)
        {
            type.ThrowIfNull("type");
            method.ThrowIfNull("method");
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            if (!type.NamespaceStartsWith(_rootNamespace))
            {
                return;
            }

            var    pathParts         = new List <string>();
            string relativeNamespace = Regex.Replace(type.Namespace, String.Format(@"^{0}\.?(?<RelativeNamespace>.*)", Regex.Escape(_rootNamespace)), "${RelativeNamespace}");

            pathParts.AddRange(ParseWords(relativeNamespace));
            pathParts.AddRange(ParseWords(type.Name));
            string relativeUrl = String.Join("/", pathParts);

            route.ResolveRelativeUrlsUsingString(relativeUrl);
        }