public void Load(long CategoryId) { ShowCategory = CategoryId == 0; var questions = CategoryId == 0 ? _surveyRepository.GetAllQuestions() : _surveyRepository.GetQuestionByCategory(CategoryId); Items = questions.Select(q => new TestQuestionDto { QuestionId = q.Id, Question = q.Question, QuestionCategory = q.Category.Name }) .ToList(); }