mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
added marr.datamapper source code for easy debugging.
This commit is contained in:
parent
58a05fcef8
commit
3cdff3bb71
96 changed files with 9198 additions and 363 deletions
23
Marr.Data/ExtensionMethods.cs
Normal file
23
Marr.Data/ExtensionMethods.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue