Added a getting started project for WolverineFx.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System.Net.Mail;
|
||||
|
||||
namespace WolverineTutorial;
|
||||
|
||||
public static class IssueCreatedHandler
|
||||
{
|
||||
public static async Task Handle(IssueCreated created, IssueRepository repository)
|
||||
{
|
||||
var issue = repository.Get(created.Id);
|
||||
var message = await BuildEmailMessage(issue);
|
||||
using var client = new SmtpClient();
|
||||
client.Send(message);
|
||||
}
|
||||
|
||||
// This is a little helper method I made public
|
||||
// Wolverine will not expose this as a message handler
|
||||
private static Task<MailMessage> BuildEmailMessage(Issue issue)
|
||||
{
|
||||
// Build up a templated email message, with
|
||||
// some sort of async method to look up additional
|
||||
// data just so we can show off an async
|
||||
// Wolverine Handler
|
||||
return Task.FromResult(new MailMessage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user