Skip to content

Add EF value converter and wireup#16

Merged
buvinghausen merged 5 commits intomasterfrom
add_entityframework_valueconverters
Mar 17, 2026
Merged

Add EF value converter and wireup#16
buvinghausen merged 5 commits intomasterfrom
add_entityframework_valueconverters

Conversation

@buvinghausen
Copy link
Copy Markdown
Owner

Add new EntityFrameworkCore assembly which supports the value conversion of the two structs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.EntityFrameworkCore with a ValueConverter<T, Guid> and a ModelConfigurationBuilder extension for convention-based registration.
  • Adds ISequentialGuid<TSelf> (net8+) and updates SequentialGuid / SequentialSqlGuid with comparison and conversion operators to support the converter.
  • Adds SequentialGuid.EntityFrameworkCore.Tests covering 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.EntityFrameworkCore project 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 update SequentialGuid/SequentialSqlGuid to implement it (including a Create(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.

@buvinghausen buvinghausen merged commit 9bcfc1a into master Mar 17, 2026
1 check passed
@buvinghausen buvinghausen deleted the add_entityframework_valueconverters branch March 17, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants