Added a getting started project for WolverineFx.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
namespace WolverineTutorial;
|
||||
|
||||
public class CreateIssueHandler(IssueRepository repository)
|
||||
{
|
||||
// The IssueCreated event message being returned will be
|
||||
// published as a new "cascaded" message by Wolverine after
|
||||
// the original message and any related middleware has
|
||||
// succeeded
|
||||
public IssueCreated Handle(CreateIssue command)
|
||||
{
|
||||
var issue = new Issue(Guid.NewGuid(), command.Title, command.Description, true, DateTimeOffset.Now,
|
||||
command.OriginatorId
|
||||
);
|
||||
|
||||
repository.Store(issue);
|
||||
|
||||
return new IssueCreated(issue.Id);
|
||||
}
|
||||
}
|
||||
|
||||
public record Issue(Guid Id, string Title, string Description, bool IsOpen, DateTimeOffset Opened, Guid OriginatorId);
|
||||
|
||||
public record IssueCreated(Guid Id);
|
||||
Reference in New Issue
Block a user