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; }
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; }