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 }); }
public async Task <IActionResult> Delete(string id) { var deleteElectricCommand = new DeleteGateWayCommand { Id = id }; var result = await _mediator.Send(deleteElectricCommand); return(Ok(result)); }