Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds System.Text.Json support for the library’s SequentialGuid and SequentialSqlGuid types by introducing JSON converters and a JsonSerializerOptions extension method to register them, while also relocating internal helper extension methods into the SequentialGuid.Extensions namespace and updating call sites/tests accordingly.
Changes:
- Added System.Text.Json converters for
SequentialGuid/SequentialSqlGuidand an options extension (AddSequentialGuidConverters) to register them. - Moved internal helper extension methods into
SequentialGuid.Extensionsand updated library/test files to import that namespace. - Added test coverage to validate converter registration behavior and round-trip serialization/deserialization.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/SequentialGuid.Tests/SequentialSqlGuidStructTests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/SequentialGuidTests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/SequentialGuidStructTests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/JsonConverterTests.cs | New tests for STJ converter registration and round-trip behavior. |
| test/SequentialGuid.Tests/GuidV8TimeTests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/GuidV8NameTests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/GuidV7Tests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/GuidV5Tests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/GuidV4Tests.cs | Imports SequentialGuid.Extensions for internal extension-method access in tests. |
| test/SequentialGuid.Tests/GuidExtensions.cs | Imports SequentialGuid.Extensions to use internal parsing helpers for tests. |
| src/SequentialGuid/SequentialSqlGuid.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/SequentialGuid.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/Obsolete/SequentialSqlGuidGenerator.cs | Adds IDE0130 suppression around namespace in obsolete generator. |
| src/SequentialGuid/Obsolete/SequentialGuidGeneratorBase.cs | Imports SequentialGuid.Extensions and adds IDE0130 suppression for obsolete generator base. |
| src/SequentialGuid/Obsolete/SequentialGuidGenerator.cs | Adds IDE0130 suppression around namespace in obsolete generator. |
| src/SequentialGuid/Json/SequentialGuidJsonConverter.cs | New generic STJ converter for ISequentialGuid<T> structs. |
| src/SequentialGuid/Json/JsonConverters.cs | New internal registry for the library’s STJ converters. |
| src/SequentialGuid/GuidV8Time.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/GuidV7.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/GuidV4.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/GuidNameBased.cs | Imports SequentialGuid.Extensions after internal extension namespace move. |
| src/SequentialGuid/Extensions/TicksExtensions.cs | Moves to SequentialGuid.Extensions namespace. |
| src/SequentialGuid/Extensions/SequentialGuidJsonOptionsExtensions.cs | New JsonSerializerOptions extension to register SequentialGuid STJ converters. |
| src/SequentialGuid/Extensions/RandomNumberGeneratorExtensions.cs | Moves to SequentialGuid.Extensions namespace. |
| src/SequentialGuid/Extensions/GuidExtensions.cs | Imports SequentialGuid.Extensions to reach moved internal helpers from namespace System. |
| src/SequentialGuid/Extensions/ByteArrayExtensions.cs | Moves to SequentialGuid.Extensions namespace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
src/SequentialGuid/Extensions/SequentialGuidJsonOptionsExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Add ability to add converters for SequentialGuid and SqlSequentialGuid for System.Text.Json to properly serialize and deserialize