EventStore / samples

Samples showing practical aspect of EventStoreDB, Event Sourcing
https://developers.eventstore.com/
MIT License
70 stars 24 forks source link

Derivation of Category name / StreamPrefix is broken #11

Open bartelink opened 2 years ago

bartelink commented 2 years ago

The logic in StreamNameMapper.ToStreamPrefix: https://github.com/EventStore/samples/blob/285a71700202166af78028d570d3d6b080c75c42/CQRS_Flow/.NET/Core/Core/Events/StreamNameMapper.cs#L23-L27 is problematic at present as it appears to map MyCompany.Domain.Cart to MyCompany_ItemAdded

While I'm not a fan of seeing the naming of events as a global thing in the first instance*, I feel that this code is worse than useless as you'll inevitably end up with multiple MyCompany_Added things if you start from this code, which will conceal the objective of the code

I'd be more than happy to make a PR to remove the prefixing logic, but would settle for any resolution that's more likely to end up with a useful convention as people inevitably paste this code around the world ;)