public async Task <WatchResponse> WatchAsync(WatcherParameter parameter) { var response = new WatchResponse(); using (var connection = new SqlConnection(parameter.Values["ConnectionString"])) { try { await connection.OpenAsync(); response.Success = true; } catch (Exception ex) { response.Message = ex.Message; response.StackTrace = ex.ToString(); } } return(response); }
public async Task <WatchResponse> WatchAsync(WatcherParameter parameter) { var response = new WatchResponse(); try { using (var httpClient = new HttpClient()) { await httpClient.GetAsync(parameter.Values["Url"]); response.Success = true; } } catch (Exception ex) { response.Message = ex.Message; response.StackTrace = ex.ToString(); } return(response); }