private IQueryable<QuestionWithDisplayName> QuestionQuery(string tag, out string header)
{
header = "Top Questions";
IQueryable<Question> questionsQuery = DocumentSession.Query<Question, Questions_Search>()
.OrderByCreatedByDescending()
.Take(20);
// Filter Questions by Tags?
if (!string.IsNullOrEmpty(tag))
{
header = "Tagged Questions";
questionsQuery = questionsQuery
.WithAnyTag(tag);
}
return questionsQuery.As<QuestionWithDisplayName>();
}