public Test Get(string id) { Test test = _testRepository.Get(id); test.Options = _testOptionRepository.GetList(id).Select((to) => (TestOption)to).ToList(); return(test); }
public ActionResult Index(string testId) { List <TestOption> options = _testOptionRepository.GetList(testId)?.Select(to => (TestOption)to).ToList(); return(View(options)); }