finaps / eventsourcing Goto Github PK
View Code? Open in Web Editor NEWEvent Sourcing in .NET 6
License: Apache License 2.0
Event Sourcing in .NET 6
License: Apache License 2.0
Current behavior:
When using multiple Apply
methods EFCore
provider doesn't preserve their order on insert.
My code that fails
Apply(new CompetitionCreatedEvent());
Apply(new CompetitionNameSetEvent(name));
Apply(new CompetitionLogoSetEvent(logo));
EF then try to sort entities alphabetically on insert thus getting into constraint violation
You can check issue here dotnet/efcore#11686
This issue lead me to PR dotnet/efcore#25874 where inserted entities are ordered using StringComparer.Ordinal
After digging source code found the piece of code that cause this
case AddEventsAction(var events):
_store.Context.AddRange(events);
break;
Proposed solution:
As a solution I can only think of Bulk insert
wrapped in transaction. Maybe you'll find a better way
The NotNull Constraints generated for each Event fail when Event.PropertyName
is not mapped to nameof(Event.PropertyName)
.
This happens when for example two Events with the same property name are mapped to the same table, but don't inherit this property from a shared base class. (see here for more info)
The NotNull implementation should be aware of EF.Core's naming conventions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.