Created
January 24, 2021 08:46
-
-
Save babaktaremi/dd1d39c1d4232f71fb158155b53262a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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