Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0bc86bb

Browse filesBrowse files
committed
Use pgTypeId for default resolution call in ObjectConverter
1 parent ea5a2e1 commit 0bc86bb
Copy full SHA for 0bc86bb

1 file changed

+2-2Lines changed: 2 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Npgsql/Internal/Converters/ObjectConverter.cs‎

Copy file name to clipboardExpand all lines: src/Npgsql/Internal/Converters/ObjectConverter.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public override Size GetSize(SizeContext context, object value, ref object? writ
3838
// We can call GetDefaultResolution here as validation has already happened in IsDbNullValue.
3939
// And we know it was called due to the writeState being filled.
4040
var converter = typeInfo is PgResolverTypeInfo resolverTypeInfo
41-
? resolverTypeInfo.GetDefaultResolution(null).Converter
41+
? resolverTypeInfo.GetDefaultResolution(pgTypeId).Converter
4242
: typeInfo.GetResolution().Converter;
4343
if (typeInfo.GetBufferRequirements(converter, context.Format) is not { } bufferRequirements)
4444
{
@@ -80,7 +80,7 @@ async ValueTask Write(bool async, PgWriter writer, object value, CancellationTok
8080
// We can call GetDefaultResolution here as validation has already happened in IsDbNullValue.
8181
// And we know it was called due to the writeState being filled.
8282
var converter = typeInfo is PgResolverTypeInfo resolverTypeInfo
83-
? resolverTypeInfo.GetDefaultResolution(null).Converter
83+
? resolverTypeInfo.GetDefaultResolution(pgTypeId).Converter
8484
: typeInfo.GetResolution().Converter;
8585
var writeRequirement = typeInfo.GetBufferRequirements(converter, DataFormat.Binary)!.Value.Write;
8686
using var _ = await writer.BeginNestedWrite(async, writeRequirement, writer.Current.Size.Value, effectiveState, cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.