Beispiel #1
0
        private void SetupDataReaderDeserializer(Type type, DbDataReader reader)
        {
            if (ReferenceEquals(type, returnType))
            {
                return;
            }

            var columnNames = DbQueryInternal.IsClrType(type) ? NoColumnNames : DbQueryInternal.GetColumnNames(reader);
            var columnTypes = DbQueryInternal.GetColumnTypes(reader);

            dataReaderDeserializer = DataReaderDeserializerCache.GetCachedOrBuildNew(connectionType, type, columnNames, columnTypes);
            returnType             = type;
        }
Beispiel #2
0
        private void SetupDataReaderDeserializer(DbDataReader reader)
        {
            if (returnType != null)
            {
                return;
            }

            var columnNames = DbQueryInternal.GetColumnNames(reader);
            var columnTypes = DbQueryInternal.GetColumnTypes(reader);

            returnType = DynamicTypeCache.GetCachedOrBuildNew(columnNames, columnTypes);

            dataReaderDeserializer = DataReaderDeserializerCache.GetCachedOrBuildNew(connectionType, returnType, columnNames, columnTypes);
        }