Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1: Convert Entity Framework #1076

Merged
merged 4 commits into from
Mar 9, 2025
Merged

Conversation

MMonrad
Copy link
Contributor

@MMonrad MMonrad commented Jan 19, 2025

This PR is upgrading Entity Framework from v0 to v1

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2025

CLA assistant check
All committers have signed the CLA.

@MMonrad MMonrad force-pushed the v1-ef-core branch 2 times, most recently from 18911ca to 828226a Compare January 19, 2025 20:18
Copy link
Member

@rasmus rasmus left a comment

Choose a reason for hiding this comment

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

fbls

This is awesome! ❤️

Some initial comments. A lot of changes and I need to sit down a do a proper review.

@MMonrad MMonrad force-pushed the v1-ef-core branch 2 times, most recently from 0eb25db to e099ecd Compare January 23, 2025 10:01
@MMonrad
Copy link
Contributor Author

MMonrad commented Jan 23, 2025

fbls [ ![fbls]

This is awesome! ❤️

Some initial comments. A lot of changes and I need to sit down a do a proper review.

Thank you Rasmus, I have been trying to keep the changes to a minimum :)

Take your time with the review, we have copied the project into our own code base 👍

@rasmus
Copy link
Member

rasmus commented Feb 11, 2025

While I'm usually not pedantic regarding squash/rebase and prefer to use merge commits to show the history. Maybe I can get you to squash this PR to remove the binary data from the commit history. It isn't much, but it does stack up. I can do it when I merge the PR, but that will remove your name from the commits and I really do prefer to have community members to have their name in the commit history to give credit ❤️

@MMonrad
Copy link
Contributor Author

MMonrad commented Feb 11, 2025

While I'm usually not pedantic regarding squash/rebase and prefer to use merge commits to show the history. Maybe I can get you to squash this PR to remove the binary data from the commit history. It isn't much, but it does stack up. I can do it when I merge the PR, but that will remove your name from the commits and I really do prefer to have community members to have their name in the commit history to give credit ❤️

Fully understandable :) It is gone from the history now ;)

@MMonrad
Copy link
Contributor Author

MMonrad commented Feb 27, 2025

@rasmus can I do more to get this in?

@rasmus
Copy link
Member

rasmus commented Feb 28, 2025

I have some time this weekend and will go though it. Sorry for the wait. I'll test out copilot reviews as a means to support me.

@rasmus rasmus requested a review from Copilot February 28, 2025 07:07

Choose a reason for hiding this comment

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

PR Overview

This PR upgrades the project from Entity Framework v0 to v1 by converting synchronous APIs to asynchronous ones and updating dependency injection patterns across test projects. Key changes include:

  • Replacing IRootResolver with IServiceProvider in test configuration methods.
  • Migrating from synchronous Apply methods to async ApplyAsync methods in read models.
  • Updating in-memory table implementations and factories to include new logger parameters and additional dependencies.

Reviewed Changes

File Description
Source/EventFlow.EntityFramework.Tests/InMemory/InMemoryDbContextProvider.cs Updates the in-memory database name to include a GUID for isolation.
Source/EventFlow.EntityFramework.Tests/PostgreSql/EfPostgreSqlSnapshotTests.cs Converts resolver creation to a method returning IServiceProvider and uses AddTransient for DI.
Source/EventFlow.EntityFramework.Tests/InMemory/EfInMemoryEventStoreTests.cs; EfInMemorySnapshotTests.cs; EfInMemoryReadStoreTests.cs Similar conversion in in-memory tests, ensuring consistent DI patterns and singleton lifetimes.
Source/EventFlow.EntityFramework.Tests/MsSql/* and PostgreSql/* tests Update resolver configuration and tear down logic (passing Logger) to support EF v1.
Source/EventFlow.EntityFramework.Tests/InMemory/Infrastructure/IndexingInMemoryTable.cs Adjusts method signatures (adding logger parameters and new methods) to align with new EF v1 API requirements.
Source/EventFlow.EntityFramework.Tests/EntityFrameworkTestExtensions.cs Replaces legacy service registration methods with AddTransient.
Source/EventFlow.EntityFramework.Tests/Model/* and MsSql/IncludeTests/ReadModels/* Migrates synchronous Apply methods to async ApplyAsync implementations.
Source/EventFlow.EntityFramework.Tests/InMemory/Infrastructure/IndexingInMemoryTableFactory.cs Updates the constructor signature to expect an additional dependency reflecting EF v1 changes.

Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.

@MMonrad
Copy link
Contributor Author

MMonrad commented Mar 9, 2025

@rasmus We are delivering a product build on EventFlow, with ef-core in a month. Do you think it would be possible to get this in before, so we can deliver this with a stable package from you?

@rasmus
Copy link
Member

rasmus commented Mar 9, 2025

Yes. I'll pick up the pace... significantly... and get it shipped

@rasmus
Copy link
Member

rasmus commented Mar 9, 2025

I'll see if I can get this shipped today

@rasmus rasmus merged commit ae22dcb into eventflow:develop-v1 Mar 9, 2025
5 checks passed
@rasmus
Copy link
Member

rasmus commented Mar 9, 2025

@MMonrad successfully released as 1.2.0 here https://www.nuget.org/packages/EventFlow.EntityFramework/1.2.0

Its a new package for v1, let me know if there's any trouble.

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.

3 participants