Move write state types out of generic converters and rename#6572
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors converter write-state handling by moving write-state wrapper types out of generic/nested converter types and renaming the late-bound object converter/provider to “LateBinding…”, aiming to reduce generic duplication while keeping visibility localized via file types.
Changes:
- Rename
ObjectConverter/LateBoundTypeInfoProvidertoLateBindingConverter/LateBindingTypeInfoProviderand update references/comments. - Extract/rename several write-state wrapper types into
file-scoped types (e.g., range/composite/multirange/hstore). - Update tests and internal comments to reflect the new late-binding naming and write-state flow.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Npgsql.Tests/WriteStateTests.cs | Updates late-binding naming in test comments; documents write-state flow. |
| src/Npgsql/NpgsqlParameter.cs | Updates internal comment to reference LateBindingConverter. |
| src/Npgsql/Internal/TypeInfoMapping.cs | Updates internal comment to reference LateBindingTypeInfoProvider. |
| src/Npgsql/Internal/ResolverFactories/AdoTypeInfoResolverFactory.cs | Updates object-array provider mapping to instantiate LateBindingTypeInfoProvider. |
| src/Npgsql/Internal/Converters/RangeConverter.cs | Renames/extracts range write-state wrapper to file-scoped RangeWriteState. |
| src/Npgsql/Internal/Converters/MultirangeConverter.cs | Renames/extracts multirange write-state wrapper type (currently introduced with invalid syntax). |
| src/Npgsql/Internal/Converters/LateBindingConverter.cs | Renames converter/provider and extracts write-state wrapper to file-scoped LateBindingWriteState. |
| src/Npgsql/Internal/Converters/HstoreConverter.cs | Renames/extracts hstore write-state wrapper type (currently introduced with invalid syntax). |
| src/Npgsql/Internal/Converters/CompositeConverter.cs | Renames/extracts composite field/write-state wrappers to file-scoped types. |
Comments suppressed due to low confidence (2)
src/Npgsql/Internal/Converters/HstoreConverter.cs:156
file sealed class HstoreWriteState : MultiWriteState;is not valid C# syntax for a class declaration (classes require a body). This will fail compilation; use an explicit empty body (e.g.{ }) or another valid type form (e.g. arecordif appropriate).
}
file sealed class HstoreWriteState : MultiWriteState;
src/Npgsql/Internal/Converters/MultirangeConverter.cs:146
file sealed class MultirangeWriteState : MultiWriteState;appears to be an invalid class declaration (missing body) and will not compile. If the intent is an empty derived type just for distinguishing write state, declare it with an empty body (e.g.{ }).
}
file sealed class MultirangeWriteState : MultiWriteState;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vonzshik
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should reduce generic duplication a bit, and with
filetypes we don't give up localized visibility either.