pjvds / ncqrs

Ncqrs Framework - The CQRS Framework for .NET
Other
539 stars 164 forks source link

Applying EntitySourcedEvent should fail on duplicate EntityId #84

Open marcofranssen opened 12 years ago

marcofranssen commented 12 years ago

In one of my aggregates I was applying by incident and entiyEvent twice on the same agregate root. When applying I applied the event twice with the same entityId. This should cause an exception because my entities within this aggregate aren't unique anymore now.

So there should be implemented an exception for applying two entities with the same id on one aggragate instance. So the entities will have unique id's within the aggregate.

pjvds commented 12 years ago

Totally agree. Entities should be unique within their aggregate root context. We will add a check soon to prevent duplicates.