public async Task <IActionResult> Delete(DeleteAgentCommand deleteAgentCommand) { var result = await mediator.Send(deleteAgentCommand); return(result ? (IActionResult)Ok(result) : (IActionResult)BadRequest()); }
public async Task <bool> Handle(DeleteAgentCommand deleteAgentCommand, CancellationToken cancellationToken) { var agent = await queryExecutor.Execute <GetAgentQuery, Agent>(new GetAgentQuery() { AgentId = deleteAgentCommand.AggregateId }); await agentRepository.DeleteAsync(agent, deleteAgentCommand.AggregateId); return(true); }
public async Task <IActionResult> Delete(DeleteAgentCommand deleteAgentCommand) { var result = await mediator.Send(deleteAgentCommand); return(NoContent()); }