Skip to content

Instantly share code, notes, and snippets.

@babaktaremi
Created January 24, 2021 08:46
Show Gist options
  • Save babaktaremi/dd1d39c1d4232f71fb158155b53262a7 to your computer and use it in GitHub Desktop.
Save babaktaremi/dd1d39c1d4232f71fb158155b53262a7 to your computer and use it in GitHub Desktop.
[HttpPost("Create")]
public async Task<IActionResult> CreateBook(AddBookRequest request)
{
var command = await _mediator.Send(request);
if (command)
{
await _mediator.Publish(new EmailNotification("admin@site.com", "A New Book Was Added"));
return Ok();
}
return BadRequest();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment