protected async Task <ReqResult> BaseLogic(Task <HttpResponseMessage> request) { try { var result = await request; if (!result.IsSuccessStatusCode) { return(ReqResult.Failed(await result.Content.ReadAsStringAsync())); } var netres = JsonConvert.DeserializeObject <ReqResult>(await result.Content.ReadAsStringAsync()); if (netres == null) { return(ReqResult.Failed()); } else { return(netres); } } catch (Exception) { return(ReqResult.Failed()); } }
public async Task <ReqResult> OpenBrowser() { try { if (_driver == null) { Setup(); } _driver.Manage().Window.Maximize(); _driver.Url = bing; return(ReqResult.Success()); } catch (Exception) { return(ReqResult.Failed()); } }