Beispiel #1
0
        public async Task <ActionResult <SMSResponse> > SendSingleMessage <T>(T rawRequest)
        {
            try
            {
                ValuesService valSvc = new ValuesService();
                IDictionary <string, string> inputParms = valSvc.GetCollectionFromRaw(rawRequest.ToString().Split("\r\n"), ":");
                string service = inputParms["Service"].ToString();

                Compose(service);

                return(await MessageService.SendMessageAsync(inputParms));
            }
            catch (Exception ex)
            {
                SMSResponse resp = new SMSResponse()
                {
                    DiagnosticInformation = string.Empty,
                    ErrorFlag             = true,
                    ErrorID      = 1,
                    ErrorMessage = ex.Message
                };

                return(new ObjectResult(resp));
            }
            finally
            {
                // get rid of the container when done --> tidy up, son
                //compContainer.Dispose();
                GC.Collect();
            }
        }