Exemplo n.º 1
0
        public async Task <GetTopicListOperationResponse> Execute()
        {
            var personalTree = await _getPersonalTopicTreeOperation.Execute();

            var learnedTopics = personalTree.Roots
                                .SelectMany(root => root.Flatten(topic => topic.Children))
                                .Where(topic => topic.Status == ProgressStatus.Learned);

            return(new GetTopicListOperationResponse
            {
                Topics = learnedTopics
                         .Select(topic => new GetTopicListOperationResponse.Topic
                {
                    Id = topic.Id,
                    Subject = topic.Subject,
                    Description = topic.Description
                })
                         .ToList()
            });
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PersonalTopicTree()
        {
            var response = await _getPersonalTopicTreeOperation.Execute();

            return(Ok(new EmployeeTopicTreeModel(response)));
        }