Beispiel #1
0
        public AjaxContinuation get_dependencies_type(AssetDependenciesRequest request)
        {
            var logs = _assetLogs.Entries
                       .Select(l => l.Name);

            IEnumerable <IGrouping <string, string> > fileNames = logs.GroupBy(x => new FileInfo(x).Extension);

            var javascripts =
                fileNames.Where(g => g.Key == ".js");

            object data = null;

            foreach (var javascript in javascripts)
            {
                var dependencies = javascript.Select(x => _graph.FileDependencyFor(x));

                data = dependencies.Select(d => new { d, fromName = d.Name }).SelectMany(@t => @t.d.Dependencies(),
                                                                                         (@t, sub) =>
                                                                                         new
                {
                    source = @t.fromName,
                    target = sub.Name,
                    type   = "suit"
                });
            }

            var datum = AjaxContinuation.Successful();

            datum["datum"] = data;

            return(datum);
        }
        public AjaxContinuation get_dependencies_type(AssetDependenciesRequest request)
        {
            var logs = _assetLogs.Entries
              .Select(l => l.Name);

            IEnumerable<IGrouping<string, string>> fileNames = logs.GroupBy(x => new FileInfo(x).Extension);

            var javascripts =
                fileNames.Where(g => g.Key == ".js");

            object data = null;
            foreach (var javascript in javascripts)
            {
                var dependencies = javascript.Select(x => _graph.FileDependencyFor(x));

                data = dependencies.Select(d => new { d, fromName = d.Name }).SelectMany(@t => @t.d.Dependencies(),
                                                                                       (@t, sub) =>
                                                                                       new
                                                                                       {
                                                                                           source = @t.fromName,
                                                                                           target = sub.Name,
                                                                                           type = "suit"
                                                                                       });
            }

            var datum = AjaxContinuation.Successful();

            datum["datum"] = data;

            return datum;
        }