Skip to content

Commit

Permalink
♻️ 63 make events record based (#64)
Browse files Browse the repository at this point in the history
* Domain events now use records.

* Don't allow prerelease version of .NET
  • Loading branch information
danielmackay committed May 9, 2023
1 parent a790e13 commit aafbadf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"version": "7.0.200",
"rollForward": "latestFeature"
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
5 changes: 1 addition & 4 deletions src/Domain/Common/BaseEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

namespace Domain.Common;

public class BaseEvent : INotification
{

}
public record BaseEvent : INotification;
7 changes: 1 addition & 6 deletions src/Domain/Events/TodoItemCreatedEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@

namespace Domain.Events;

public class TodoItemCreatedEvent : BaseEvent
{
public TodoItemCreatedEvent(TodoItem item) => Item = item;

public TodoItem Item { get; }
}
public record TodoItemCreatedEvent(TodoItem Item) : BaseEvent;

0 comments on commit aafbadf

Please sign in to comment.