Skip to content

Instantly share code, notes, and snippets.

@Qrtic
Created August 22, 2021 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qrtic/5cf6ade019230fabf8313042a21c42b8 to your computer and use it in GitHub Desktop.
Save Qrtic/5cf6ade019230fabf8313042a21c42b8 to your computer and use it in GitHub Desktop.
public class FireAndForgetHandler
{
private readonly IEmailService _emailService;
private readonly ILogger _logger;
public FireAndForgetHandler(IEmailService emailService, ILogger logger)
{
_emailService = emailService;
_logger = logger;
}
public void HandleNotification(INotification notification)
{
try
{
_emailService.SendMessage(notification.Message);
}
catch (Exception e)
{
_logger.Log(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment