Closed AlsenDev closed 1 year ago
I suspect this is due to framework targeting / version reference issues in the EventFlow.EntityFramework project; I found that EF Core 6 works if you register a new service with implementation of IEntityFrameworkReadModelStore
Is there an update on this? I cannot get it figured out and it is blocking me hard.
You have to target EntityFrameworks nuget packages with version 5.X.X to have it working. Seems it won't be fixed in EventFlow 0.X but only in 1.X
I solved this by implementing my own EntityFrameworkReadModel service so it will use the EF version that my project uses instead of EventFlow as was suggested by @rthomson83 above. Even implemented its own extension method for UseEntityFrameworkReadModel. This is working perfectly and when/if this gets fixed in 1.X it should be simple to point back to the EventFlow version.
@jessemillerrev do you have an example? I'm struggling with the same issue now..
@jessemillerrev do you have an example? I'm struggling with the same issue now..
Start by adding a new store like this one: https://github.com/rthomson83/eventflow-ef-core-fix/blob/main/EntityFrameworkCoreReadModelStore.cs
Then you can create a new extension method to make using it easier: https://github.com/rthomson83/eventflow-ef-core-fix/blob/main/EFReadStoreExtensions.cs
Finally use/register the service via autofac however you are using that. For me it was a module that has all the EF configuration for eventflow read store side: https://github.com/rthomson83/eventflow-ef-core-fix/blob/main/ReadStoreModule.cs
@rthomson83 I wish I had those links before I figured it all out! Thanks for posting that, hopefully others will benefit from your awesome work there.
Thank you very much @rthomson83 for the snippets.
I've just checked and your implementation indeed solves the problem. Although I'm not sure if we can use this on production :(, unfortunately. I also noticed that it generates the wrong Version
number (0
instead of 1
)...
Thanks again!
Thank you very much @rthomson83 for the snippets. I've just checked and your implementation indeed solves the problem. Although I'm not sure if we can use this on production :(, unfortunately. I also noticed that it generates the wrong
Version
number (0
instead of1
)...Thank again!
No worries, I did notice that with the version but it does increment. I've not changed anything in the store (that's the original code from the event flow repo). I'm pretty sure the version is like that because its not been set default in the read model property Version, defined with the ConcurrencyCheck attribute. If you start it at 1 it would increment from there.
Hello there!
We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.
If you still require assistance with this issue, please feel free to reopen it or create a new issue.
Thank you for your understanding and cooperation.
Best regards, EventFlow
Hello there!
This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.
Thank you for your contribution to this repository.
Best regards, EventFlow
I get this exception when trying to call PublishAsync() from the CommandBus. It seems to be a problem that occurs when using EFCore 6. I got this exception while using EFCore 6.0.0-preview.7 with the newest version of EventFlow, but I get the same error on RC 2.
I don't know if EFCore 6 support is planned yet, but I thought I at least should mention this error.