public ActionResult Details(int id, int? categoryId)
{
var question = _questionRepository.GetNullableById(id);
if (question == null)
{
Message = "Question not found.";
return this.RedirectToAction<ErrorController>(a => a.Index());
}
var viewModel = QuestionDetailViewModel.Create(Repository, question);
if (categoryId.HasValue && categoryId.Value != 0)
{
viewModel.Category = question.Category;
}
viewModel.UniqueTags = Repository.OfType<PhotoTag>().Queryable.OrderBy(b => b.Name).Select(a => a.Name).Distinct().ToList();
return View(viewModel);
}