Ejemplo n.º 1
0
        public IEnumerable <CrumbNode> ActivityGroupTreeWalk(DashboardRequest request)
        {
            var configuration = SliceService.Configurations[request.Section];
            var terminalGuid  = request.ActivityGroupId;
            var groups        = context
                                .ActivityGroupsTreeWalk(terminalGuid)
                                .ToArray();
            var initialNode = new CrumbNode(configuration.DisplayName, costCode: request.CostCode);
            var take        = true;
            var nodes       = groups
                              .TakeWhile(@group =>
            {
                if ((take) && (configuration.ActivityIds.Contains(@group.Id)))
                {
                    take = false;
                    return(true);
                }
                return(take);
            })
                              .Select(@group => new CrumbNode(@group.Name, @group.Id, request.CostCode))
                              .ToList();

            nodes.Add(initialNode);
            return(nodes);
        }