mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
24 lines
606 B
C#
24 lines
606 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
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);
|
|
}
|
|
}
|
|
}
|