Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new SequentialGuid.EntityFrameworkCore integration assembly to enable automatic EF Core value conversion for the library’s sequential GUID structs, plus tests validating converter registration and round-tripping.
Changes:
- Introduces
SequentialGuid.EntityFrameworkCorewith aValueConverter<T, Guid>and aModelConfigurationBuilderextension for convention-based registration. - Adds
ISequentialGuid<TSelf>(net8+) and updatesSequentialGuid/SequentialSqlGuidwith comparison and conversion operators to support the converter. - Adds
SequentialGuid.EntityFrameworkCore.Testscovering converter wiring and in-memory round-trip behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/SequentialGuid.EntityFrameworkCore.Tests/ValueConverterTests.cs | New tests verifying EF converter registration and round-tripping via InMemory provider |
| test/SequentialGuid.EntityFrameworkCore.Tests/SequentialGuid.EntityFrameworkCore.Tests.csproj | New multi-targeted EF Core test project referencing EF InMemory + new EFCore integration project |
| src/SequentialGuid/SequentialSqlGuid.cs | Adds comparability + implicit conversions and net8+ ISequentialGuid implementation |
| src/SequentialGuid/SequentialGuid.cs | Adds comparability + implicit conversions and net8+ ISequentialGuid implementation |
| src/SequentialGuid/ISequentialGuid.cs | New net8+ interface to provide a common shape for generic value conversion |
| src/SequentialGuid.EntityFrameworkCore/SequentialGuidValueConverter.cs | New generic EF Core value converter from sequential GUID structs to Guid |
| src/SequentialGuid.EntityFrameworkCore/SequentialGuid.EntityFrameworkCore.csproj | New EF Core integration project with conditional EF Core package versions per TFM |
| src/SequentialGuid.EntityFrameworkCore/ModelConfigurationBuilderExtensions.cs | New EF Core convention registration extension (AddSequentialGuidValueConverters) |
| SequentialGuid.slnx | Adds new projects to solution and normalizes paths |
💡 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.EntityFrameworkCore/ModelConfigurationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR introduces an Entity Framework Core integration layer for SequentialGuid and SequentialSqlGuid via value converters, and adds MongoDB BSON serializer support to round-trip these structs cleanly through MongoDB serialization.
Changes:
- Add
SequentialGuid.EntityFrameworkCoreproject with EF Core convention-based value converter registration. - Add MongoDB BSON serializers + a registration extension, plus tests validating registration and round-tripping.
- Introduce
ISequentialGuid<TSelf>and updateSequentialGuid/SequentialSqlGuidto implement it (including aCreate(Guid)factory).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/SequentialGuid.MongoDB.Tests/SequentialGuidMongoTests.cs | Adds round-trip tests for the new MongoDB BSON serializers. |
| test/SequentialGuid.MongoDB.Tests/SequentialGuid.MongoDB.Tests.csproj | Removes direct MongoDB.Bson package reference in favor of transitive dependency via project reference. |
| test/SequentialGuid.MongoDB.Tests/BsonSerializerExtensionsTests.cs | Adds tests ensuring sequential GUID serializers are registered via the new registration extension. |
| test/SequentialGuid.EntityFrameworkCore.Tests/ValueConverterTests.cs | Adds tests validating EF Core converter registration and round-tripping with the InMemory provider. |
| test/SequentialGuid.EntityFrameworkCore.Tests/SequentialGuid.EntityFrameworkCore.Tests.csproj | Adds new EF Core test project and EF Core InMemory package references per TFM. |
| src/SequentialGuid/SequentialSqlGuid.cs | Implements ISequentialGuid<> and adds Create(Guid); refactors ctor validation flow. |
| src/SequentialGuid/SequentialGuid.cs | Implements ISequentialGuid<> and adds Create(Guid). |
| src/SequentialGuid/ISequentialGuid.cs | Adds a shared interface to unify conversion/serialization shape across sequential GUID structs. |
| src/SequentialGuid.MongoDB/Serializers/SequentialGuidSerializer.cs | Adds BSON serializers for SequentialGuid and SequentialSqlGuid. |
| src/SequentialGuid.MongoDB/Serializers/SequentialGuidSerializationProvider.cs | Adds BSON serialization provider to supply serializers (including nullable forms). |
| src/SequentialGuid.MongoDB/Serializers/BsonSerializerExtensions.cs | Adds registration extension for installing the serialization provider. |
| src/SequentialGuid.MongoDB/SequentialGuid.MongoDB.csproj | Updates MongoDB.Bson dependency version. |
| src/SequentialGuid.EntityFrameworkCore/SequentialGuidValueConverter.cs | Adds a generic EF Core value converter based on ISequentialGuid<>. |
| src/SequentialGuid.EntityFrameworkCore/SequentialGuid.EntityFrameworkCore.csproj | Adds new EF Core integration project and EF Core package references per TFM. |
| src/SequentialGuid.EntityFrameworkCore/ModelConfigurationBuilderExtensions.cs | Adds convention-based converter registration on ModelConfigurationBuilder. |
| SequentialGuid.slnx | Wires the new EF Core projects into the solution and normalizes paths. |
💡 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.
Add new EntityFrameworkCore assembly which supports the value conversion of the two structs