コード例 #1
0
        public IDictionary<string, object> Write(IEnumerable<JavascriptRoute> routes)
        {
            var node = new DictionaryMediaNode();

            routes.Each(x => {
                var child = node.AddChild(x.Name);
                x.WriteNode(child, _request, _resolver);
            });

            return node.Values;
        }
コード例 #2
0
        public IDictionary<string, object> Write(IEnumerable<JavascriptRoute> routes)
        {
            var node = new DictionaryMediaNode();

            routes.Each(x => {
                var child = node.AddChild(x.Name);
                var chain = x.FindChain(_resolver);
                child.SetAttribute("name", x.Name);
                child.SetAttribute("method", x.Method);

                child.SetAttribute("url", _routeData.ToUrl(chain));

                var parameters = _routeData.ToParameters(chain);
                if (parameters.Any())
                {
                    child.SetAttribute("params", parameters);
                }
                


            });

            return node.Values;
        }