-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- GetMetricsAsync() - GetMetricsAsync(string)
- Loading branch information
1 parent
56545c4
commit 5f16e4f
Showing
8 changed files
with
338 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Data.Common; | ||
|
||
namespace Npgmq; | ||
|
||
internal static class DbDataReaderExtensions | ||
{ | ||
/// <summary> | ||
/// Get the ordinal of a column by name, or -1 if the column does not exist. | ||
/// </summary> | ||
/// <param name="reader">The reader.</param> | ||
/// <param name="columnName">The column name.</param> | ||
/// <returns>The ordinal position of the column, or -1 if it does not exist in the reader.</returns> | ||
public static int TryGetOrdinal(this DbDataReader reader, string columnName) | ||
{ | ||
try | ||
{ | ||
return reader.GetOrdinal(columnName); | ||
} | ||
catch (IndexOutOfRangeException) | ||
{ | ||
return -1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.