Skip to content

Commit

Permalink
GitBook: [master] one page modified
Browse files Browse the repository at this point in the history
  • Loading branch information
mynkow authored and gitbook-bot committed Oct 1, 2020
1 parent ccd6f15 commit ae6d652
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/message-types/events.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# Events

Domain events represent business changes which already happened.

## Communication Guide Table

| Triggered by | Description |
| :--- | :--- |
| AggregateRoot | TODO |

{% hint style="success" %}
**You can/should/must...**

* an event **must** be immutable
* an event **must** represent a domain event which already happened with a name in past tense
* an event **can** be dispatched only by one aggregate
{% endhint %}

## Examples

```csharp
[DataContract(Name = "fff400a3-1af0-4332-9cf5-b86c1c962a01")]
public class AccountSuspended : IEvent
{
AccountSuspended() { }

public AccountSuspended(AccountId id)
{
Id = id;
}

[DataMember(Order = 1)]
public AccountId Id { get; private set; }

public override string ToString()
{
return "Account was suspended";
}
}
```

0 comments on commit ae6d652

Please sign in to comment.