Created
January 16, 2021 12:16
-
-
Save babaktaremi/23883059e79e13c8d14fef42f0c3620c 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
public class AccountController : BaseController | |
{ | |
private readonly IMediator _mediator; | |
public AccountController(IMediator mediator) | |
{ | |
_mediator = mediator; | |
} | |
[HttpPost("CreateUser")] | |
public async Task<IActionResult> CreateUser(UserCreateCommand model) | |
{ | |
var result = await _mediator.Send(model); // returns a bool value | |
if (result) | |
return Ok(); | |
return BadRequest(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment