public ActionResult <IEnumerable <TopicView> > GetTopicsList() { return(Execute(() => { IEnumerable <Topic> topics = TopicService.GetAll().OrderBy(o => o.Path, StringComparer.InvariantCultureIgnoreCase).ThenBy(o => o.Name, StringComparer.InvariantCultureIgnoreCase); List <TopicView> topicViews = new List <TopicView>(); foreach (Topic topic in topics) { topicViews.Add(TopicFactory.CreateView(topic)); } return Ok(topicViews); })); }