-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccd6f15
commit ae6d652
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
``` | ||
|