You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
The validations of the command could be done based on a MediatR Decorator Pattern, instead of a control sentence within the controller. See:
Validating Commands with the Decorator Pattern http://codeopinion.com/validating-commands/
So the final controller should look like this:
[Route("new")]
[HttpPost]
public async Task<IActionResult> CreateOrder([FromBody]CreateOrderCommand createOrderCommand)
{
var result = await _mediator.SendAsync(createOrderCommand);
if (result)
{
return Ok();
}
return BadRequest();
}
The text was updated successfully, but these errors were encountered:
Need to refactor. Our current implementation is:
We need to move the obtention of the identity to the CommandHandler, so the Command could be Immutable as we won't need to update the Identity into the Command object
_identityService.GetUserIdentity();
This issue is related to issue Make immutable Commands and remove behavior from the Command classes - i.e. CreateOrderCommand #36 - Make immutable Commands and remove behavior from the Command classes - i.e. CreateOrderCommand #36
The validations of the command could be done based on a MediatR Decorator Pattern, instead of a control sentence within the controller. See:
Validating Commands with the Decorator Pattern
http://codeopinion.com/validating-commands/
So the final controller should look like this:
The text was updated successfully, but these errors were encountered: