EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

Why does Aggregate Id have to be a Guid?

Open JackHerring opened this issue 8 years ago • 2 comments

See line 111 here https://github.com/eventflow/EventFlow/blob/92e05a7e1bace5283fe219bd21a7bfef3805d8e1/Source/EventFlow/Core/Identity.cs

Is there a good reason for this? I have a use case where my Ids are coming from an external system and are not Guids. I can have an arbitrary Id alongside the external Id (as a 'reference' I guess) but it seems like an unnecessary restriction.

JackHerring avatar Aug 23 '18 19:08 JackHerring

@JackHerring There's absolutely no need, its merely the default implementation that fits most. If you need something else, just disregard the Identity<> implementation and create your own, it merely needs to implement the IIdentity interface.

There's even a test that verifies a custom implementation is possible.

https://github.com/eventflow/EventFlow/blob/develop/Source/EventFlow.Tests/Exploration/CustomAggregateIdExplorationTest.cs

rasmus avatar Aug 24 '18 05:08 rasmus

@rasmus got it, thank you

JackHerring avatar Aug 24 '18 06:08 JackHerring