public async Task DoWork() { if (_queryUnchanged) { // Reuse old results Messenger.Base.Send(new OldQueryMsg()); viewService.ShowView(); } else { // Flush old results waiting for new results Messenger.Base.Send(new NewQueryMsg(Query)); GetGoogleService service = new GetGoogleService(Query, _langCode.LangToCode(Language)); var results = await service.GetGoogleSearches(); if (results == null || results.Count == 0) { throw new NoResultException(); } // Send new results and show results view Messenger.Base.Send(results); _queryUnchanged = true; viewService.ShowView(); } }