Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(DeleteAgentCommand deleteAgentCommand)
        {
            var result = await mediator.Send(deleteAgentCommand);

            return(result ?
                   (IActionResult)Ok(result) :
                   (IActionResult)BadRequest());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Delete(DeleteAgentCommand deleteAgentCommand)
        {
            var result = await mediator.Send(deleteAgentCommand);

            return(NoContent());
        }