public async Task <QuestionsViewModel> Get(string text, int?toDate, int?fromDate, string sort = "activity", string order = "desc") { SearchContext searchContext = new SearchContext(); searchContext.Text = text; searchContext.ToDate = toDate; searchContext.FromDate = fromDate; if (searchContext.Hasvalue()) { QuestionsViewModel vm = await StackExchangeViewModelBuilder.Search(searchContext, sort, order); return(vm); } else { QuestionsViewModel vm = await StackExchangeViewModelBuilder.AllQuestions(sort, order); return(vm); } }
public async Task <DetailViewModel> Get(int idQuestion) { DetailViewModel vm = await StackExchangeViewModelBuilder.Details(idQuestion); return(vm); }