Пример #1
0
        public static List <T> AutoMap <T>(this IDataReader reader)
        {
            System.Type t = typeof(T);
            List <T>    result;

            if (t.IsPrimitive || t.Equals(typeof(string)) || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(System.Nullable <>)))
            {
                result = DatabaseUtilities.autoMapSimpleType <T>(reader);
            }
            else
            {
                result = reader.AutoMap <T>(new ColumnNameMapping[0]);
            }
            return(result);
        }
Пример #2
0
 public static List <T> AutoMap <T>(this IDataReader reader, params string[] autoMapColumns) where T : new()
 {
     return(reader.AutoMap <T>(null, autoMapColumns));
 }