示例#1
0
        public IActionResult CapitalizeControl([FromBody] CapitalizeRequest request)
        {
            CapitalizeResponse capResonse;

            try
            {
                _cap.ValidateRequest(request);
                string[] words = request.stringToModify.Split(' ');

                Thread thread1 = new Thread(() => ControllerHelperFunctions.databaseWordTransaction(words, _DB));
                thread1.Start();

                capResonse = _cap.ProccessRequest(request);
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }

            return(StatusCode(200, capResonse));
        }
示例#2
0
        public IActionResult BinaryControl([FromBody] BinaryRequest request)
        {
            BinaryResponse binResonse;

            try
            {
                //_bin.ValidateRequest(request);
                string[] words = request.stringToModify.Split(' ');

                Thread thread1 = new Thread(() => ControllerHelperFunctions.databaseWordTransaction(words, _DB));
                thread1.Start();

                binResonse = _bin.ProccessRequest(request);
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }

            return(StatusCode(200, binResonse));
        }
示例#3
0
        public IActionResult LowercaseControl([FromBody] LowercaseRequest lowercaseRequest)
        {
            LowercaseResponse lowResponse;

            try
            {
                _low.ValidateRequest(lowercaseRequest);
                string[] words = lowercaseRequest.stringToModify.Split(' ');

                Thread thread1 = new Thread(() => ControllerHelperFunctions.databaseWordTransaction(words, _DB));
                thread1.Start();

                lowResponse = _low.ProcessRequest(lowercaseRequest);
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }

            return(StatusCode(200, lowResponse));
        }