Exemple #1
0
        public TransactionResult <IRoverDto> Create(IPlateauDto plateau, string roverPositionText)
        {
            var result = new TransactionResult <IRoverDto>();

            try
            {
                result.ResponseObject = _roverBusiness.Create(plateau, roverPositionText);
                result.SetStatusSucceeded("Transaction succeed.");
            }
            catch (ValidationException ve)
            {
                result.SetStatusValidationException(ve.Message);
            }
            catch (Exception ex)
            {
                result.SetStatusUnhandledException(ex);
            }

            return(result);
        }
Exemple #2
0
        public TransactionResult Explore(IRoverDto rover, string commandText)
        {
            var result = new TransactionResult <IRoverDto>();

            try
            {
                _roverBusiness.Explore(rover, commandText);
                result.SetStatusSucceeded("Transaction succeed.");
            }
            catch (ValidationException ve)
            {
                result.SetStatusValidationException(ve.Message);
            }
            catch (Exception ex)
            {
                result.SetStatusUnhandledException(ex);
            }

            return(result);
        }
        public TransactionResult <IPlateauDto> Create(string widthHeightText)
        {
            var result = new TransactionResult <IPlateauDto>();

            try
            {
                result.ResponseObject = _plateauBusiness.Create(widthHeightText);
                result.SetStatusSucceeded("Transaction succeed.");
            }
            catch (ValidationException ve)
            {
                result.SetStatusValidationException(ve.Message);
            }
            catch (Exception ex)
            {
                result.SetStatusUnhandledException(ex);
            }

            return(result);
        }