1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00
Sonarr/Marr.Data/ExtensionMethods.cs
2013-07-18 20:47:55 -07:00

19 lines
520 B
C#

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);
}
}
}