private IObservable <(string, IEnumerable <AutocompleteSuggestion>)> getSuggestions(string text) { var wordsToQuery = text.SplitToQueryWords(); return(interactorFactory .GetTagsAutocompleteSuggestions(wordsToQuery).Execute() .Select(suggestions => (text, suggestions))); }
public IObservable <IEnumerable <AutocompleteSuggestion> > Execute() { var wordsToQuery = queryInfo.Text.SplitToQueryWords(); switch (queryInfo.SuggestionType) { case AutocompleteSuggestionType.Projects: return(interactorFactory.GetProjectsAutocompleteSuggestions(wordsToQuery).Execute()); case AutocompleteSuggestionType.Tags: return(interactorFactory.GetTagsAutocompleteSuggestions(wordsToQuery).Execute()); } return(wordsToQuery.Count == 0 ? Observable.Return(QuerySymbolSuggestion.Suggestions) : interactorFactory.GetTimeEntriesAutocompleteSuggestions(wordsToQuery).Execute()); }