Skip to content

Instantly share code, notes, and snippets.

@babaktaremi
Created January 16, 2021 12:16
Show Gist options
  • Save babaktaremi/23883059e79e13c8d14fef42f0c3620c to your computer and use it in GitHub Desktop.
Save babaktaremi/23883059e79e13c8d14fef42f0c3620c to your computer and use it in GitHub Desktop.
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