diff --git a/src/Marten/Services/SystemTextJsonSerializer.cs b/src/Marten/Services/SystemTextJsonSerializer.cs index 3a9207cde7..d7b2f2a0cc 100644 --- a/src/Marten/Services/SystemTextJsonSerializer.cs +++ b/src/Marten/Services/SystemTextJsonSerializer.cs @@ -81,7 +81,7 @@ public async ValueTask FromJsonAsync(Stream stream, CancellationToken canc public async ValueTask FromJsonAsync(DbDataReader reader, int index, CancellationToken cancellationToken = default) { - await using var stream = await reader.As().GetStreamAsync(index, cancellationToken) + await using var stream = await reader.GetFieldValueAsync(index, cancellationToken) .ConfigureAwait(false); return await FromJsonAsync(stream, cancellationToken).ConfigureAwait(false); } @@ -94,7 +94,7 @@ public object FromJson(Type type, Stream stream) public object FromJson(Type type, DbDataReader reader, int index) { - return FromJson(type, reader.As().GetStream(index)); + return FromJson(type, reader.GetFieldValue(index)); } public async ValueTask FromJsonAsync(Type type, Stream stream, @@ -108,7 +108,7 @@ public async ValueTask FromJsonAsync(Type type, Stream stream, public async ValueTask FromJsonAsync(Type type, DbDataReader reader, int index, CancellationToken cancellationToken = default) { - await using var stream = await reader.As().GetStreamAsync(index, cancellationToken) + await using var stream = await reader.GetFieldValueAsync(index, cancellationToken) .ConfigureAwait(false); return await FromJsonAsync(type, stream, cancellationToken).ConfigureAwait(false); } @@ -211,6 +211,6 @@ public JsonDocument JsonDocumentFromJson(Stream stream) public JsonDocument JsonDocumentFromJson(DbDataReader reader, int index) { - return JsonDocumentFromJson(reader.As().GetStream(index)); + return JsonDocumentFromJson(reader.GetFieldValue(index)); } }