public async Task <Result <bool> > Handle(DeleteGateCommand request, CancellationToken cancellationToken) { try { await _gateRepository.Delete(request.Id); return(Result <bool> .Ok(true)); } catch (Exception e) { return(Result <bool> .Failure(e.Message)); } }
public void DeleteGate(int id) { _gateRepository.Delete(_gateRepository.GetById(id)); SaveGate(); }