mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-29 09:05:28 +01:00
Moved source code under src folder - massive change
This commit is contained in:
19
src/Marr.Data/ExtensionMethods.cs
Normal file
19
src/Marr.Data/ExtensionMethods.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Marr.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// This class contains public extension methods.
|
||||
/// </summary>
|
||||
public static class ExtensionMethods
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value from a DbDataReader by using the column name;
|
||||
/// </summary>
|
||||
public static T GetValue<T>(this DbDataReader reader, string columnName)
|
||||
{
|
||||
int ordinal = reader.GetOrdinal(columnName);
|
||||
return (T)reader.GetValue(ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user