Entity
An entity is an object that has an identity and is mutable. Each entity is uniquely identified by an ID rather than by its properties; therefore, two entities can be considered equal if both of them have the same ID even though they have different properties.
You can define an entity with Cronus using the Entity<TAggregateRoot, TEntityState> base class. To publish an event from an entity, use the Apply(IEvent @event) method provided by the base class.
The entity state keeps current data of the entity and is responsible for changing it based on events raised only by the same entity.
Use the abstract helper class EntityState<TEntityId> to create an entity state. It can be accessed in the entity using the statefield provided by the base class. Also, you can implement the IEntityState interface by yourself in case inheritance is not a viable option.
To change the state of an entity, create event-handler methods for each event with a method signature public void When(Event e) { ... }.
All entity ids must implement the IEntityId interface. Since Cronus uses for ids that will require implementing the as well. If you don't want to do that, you can use the provided helper base class EntityId<TAggregateRootId>.