示例#1
0
        public async Task <Response <string> > Handle(DeleteGateWayCommand request, CancellationToken cancellationToken)
        {
            _logger.LogInfo($"DeleteGateWayHandler(Id:{request.Id})");

            await _repository.DeleteByIdAsync(request.Id);

            return(new Response <string> {
                Data = request.Id, ErrorMessage = string.Empty
            });
        }
示例#2
0
        public async Task <IActionResult> Delete(string id)
        {
            var deleteElectricCommand = new DeleteGateWayCommand {
                Id = id
            };

            var result = await _mediator.Send(deleteElectricCommand);

            return(Ok(result));
        }