public TopicData GetTopicData(DateTime fromDate, DateTime toDate) { var topicService = new TopicService(DatabaseContext); var allSolvedTopics = topicService.GetAllTopicsCount(unsolved: false); var allUnsolvedTopics = topicService.GetAllTopicsCount(unsolved: true); var limitedSolvedTopics = topicService.GetAllTopicsCountByDateRange(fromDate, toDate, unsolved: false); var limitedUnsolvedTopics = topicService.GetAllTopicsCountByDateRange(fromDate, toDate, unsolved: true); var topicData = new TopicData { AllTopics = allSolvedTopics + allUnsolvedTopics, AllSolvedTopics = allSolvedTopics, AllUnsolvedTopics = allUnsolvedTopics, AllTopicsDateRange = limitedSolvedTopics + limitedUnsolvedTopics, AllSolvedTopicsDateRange = limitedSolvedTopics, AllUnsolvedTopicsDateRange = limitedUnsolvedTopics }; return(topicData); }