Inheritance: IInboundMessage
        public void Ask(IApiContext apiContext)
        {
            var message = (string)apiContext.Request["Message"];
            if (string.IsNullOrEmpty(message))
            {
                apiContext.ResultCode = ApiResultCode.InvalidBody;
                return;
            }

            var inboundMessage = new ApiInboundMessage(DateTime.Now, message);
            var answer = ProcessMessage(inboundMessage);

            apiContext.Response["Answer"] = answer;
        }
Esempio n. 2
0
        public void Ask(IApiContext apiContext)
        {
            var message = (string)apiContext.Request["Message"];

            if (string.IsNullOrEmpty(message))
            {
                apiContext.ResultCode = ApiResultCode.InvalidBody;
                return;
            }

            var inboundMessage = new ApiInboundMessage(DateTime.Now, message);
            var answer         = ProcessMessage(inboundMessage);

            apiContext.Response["Answer"] = answer;
        }