using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace betrace_carfi_erp_driver.Common
{
    public static class SqlReaderExtension
    {
        public static T GetValue<T>(this SqlDataReader reader, string columnName)
        {
            var value = reader[columnName]; // read column value

            return value == DBNull.Value ? default(T) : (T)value;
        }
    }
}
