Esempio n. 1
0
        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));
            }
        }
Esempio n. 2
0
 public void DeleteGate(int id)
 {
     _gateRepository.Delete(_gateRepository.GetById(id));
     SaveGate();
 }