/// <summary> /// Executes Kusto query to obtain service data that includes manual review data. /// </summary> /// <param name="criteria">Service ID, service name or blank string to return the complete list of services.</param> /// <returns> /// A list of <see cref="SloRecord"/> objects with a potential <see cref="SloValidationException"/> list that is /// returned as a tuple. /// </returns> public Task <Tuple <List <SloRecord>, List <SloValidationException> > > ExecuteQueryAsync(string criteria) { string kustoQuery; if (string.IsNullOrWhiteSpace(criteria)) { kustoQuery = "GetSloJsonActionItemReport() "; } else if (GuidEx.IsGuid(criteria)) { kustoQuery = $"GetSloJsonActionItemReport() | where ServiceId == '{criteria.Trim()}' "; } else if (!GuidEx.IsGuid(criteria)) { kustoQuery = $"GetSloJsonActionItemReport() | where ServiceName contains '{criteria.Trim()}' "; } else { kustoQuery = criteria; } return(Task.Run(() => { return queryManager_.ExecuteQuery(kustoQuery); })); }
Task <Tuple <List <SloRecord>, List <SloValidationException> > > ExecuteQueryAsync(string query) { string updateQuery; if (GuidEx.IsGuid(query)) { updateQuery = $"GetSloJsonActionItemReport() | where ServiceId == '{query}'"; query = updateQuery; } else if (!GuidEx.IsGuid(query)) { updateQuery = $"GetSloJsonActionItemReport() | where ServiceName contains '{query}'"; query = updateQuery; } updateQuery = ""; return(Task.Run(() => { return queryManager_.ExecuteQuery(query); })); }