コード例 #1
0
        internal static BufferedDataRecord Initialize(
            string providerManifestToken, DbProviderServices providerServices, DbDataReader reader, Type[] columnTypes,
            bool[] nullableColumns)
        {
            var record = new ShapedBufferedDataRecord();

            record.ReadMetadata(providerManifestToken, providerServices, reader);

            DbSpatialDataReader spatialDataReader = null;

            if (columnTypes.Any(t => t == typeof(DbGeography) || t == typeof(DbGeometry)))
            {
                spatialDataReader = providerServices.GetSpatialDataReader(reader, providerManifestToken);
            }

            return(record.Initialize(reader, spatialDataReader, columnTypes, nullableColumns));
        }
コード例 #2
0
        internal static Task <BufferedDataRecord> InitializeAsync(
            string providerManifestToken, DbProviderServices providerServices, DbDataReader reader, Type[] columnTypes,
            bool[] nullableColumns, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var record = new ShapedBufferedDataRecord();

            record.ReadMetadata(providerManifestToken, providerServices, reader);

            DbSpatialDataReader spatialDataReader = null;

            if (columnTypes.Any(t => t == typeof(DbGeography) || t == typeof(DbGeometry)))
            {
                spatialDataReader = providerServices.GetSpatialDataReader(reader, providerManifestToken);
            }

            return(record.InitializeAsync(reader, spatialDataReader, columnTypes, nullableColumns, cancellationToken));
        }