private async Task GenerateFmtOnlyResultsetsAsync(string connectionString, CachedRoutine newCachedRoutine) { try { // get schema details of all result sets (var resultSets, var resultSetError) = await OrmDAL.RoutineGetFmtOnlyResultsAsync(connectionString, newCachedRoutine.Schema, newCachedRoutine.Routine, newCachedRoutine.Parameters); if (resultSets != null) { var resultSetsDictionary = new Dictionary <string, List <ResultSetFieldMetadata> >(); foreach (DataTable dt in resultSets.Tables) { var lst = new List <ResultSetFieldMetadata>(); for (var rowIx = 0; rowIx < dt.Rows.Count; rowIx++) { DataRow row = dt.Rows[rowIx]; var schemaRow = new ResultSetFieldMetadata() { ColumnName = (string)row["ColumnName"], DataType = GetCSharpType(row), DbDataType = (string)row["DataTypeName"], ColumnSize = Convert.ToInt32(row["ColumnSize"]), NumericalPrecision = Convert.ToUInt16(row["NumericPrecision"]), NumericalScale = Convert.ToUInt16(row["NumericScale"]) }; lst.Add(schemaRow); } resultSetsDictionary.Add(dt.TableName, lst); } newCachedRoutine.ResultSetMetadata = resultSetsDictionary; var resultSetJson = JsonConvert.SerializeObject(resultSetsDictionary); using (var hash = SHA256Managed.Create()) { newCachedRoutine.ResultSetHash = string.Concat(hash.ComputeHash(System.Text.Encoding.UTF8 .GetBytes(resultSetJson)) .Select(item => item.ToString("x2"))); } newCachedRoutine.ResultSetRowver = newCachedRoutine.RowVer; newCachedRoutine.ResultSetError = resultSetError; } } catch (Exception e) { newCachedRoutine.ResultSetRowver = newCachedRoutine.RowVer; newCachedRoutine.ResultSetError = e.ToString(); } }