Esempio n. 1
0
        public async Task <TerminalResponse> SaveAssync(Terminal terminal)
        {
            try
            {
                await _terminalRepository.AddAsync(terminal);

                await _unitOfWork.CompleteAsync();

                return(new TerminalResponse(terminal));
            }
            catch (Exception e)
            {
                return(new TerminalResponse($"An error ocurred while saving the terminal: {e.Message}"));
            }
        }