예제 #1
0
        public ActionResult GetSampleRequestResponse(string receivedresponse1, string receivedresponse2, string receivedresponse3)
        {
            var sendResponse = new RequestResponse();
            //var layerAndResponse = new string[] { };
            var layerAndResponse = new List <string[]>();

            SuggestionPaths sub = new SuggestionPaths();

            if (sub.checkvalid(receivedresponse1, receivedresponse2))
            {
                if (sub.checkvalid(receivedresponse2, receivedresponse3))
                {
                    var products = _repository.GetfinalProducts(receivedresponse1, receivedresponse2, receivedresponse3);
                    return(Ok(products));
                }
                else
                {
                    return(BadRequest());
                }
                //var list = sub.NextLayer(receivedresponse2);
                // return list;
            }
            else
            {
                return(BadRequest());
            }
            // layerAndResponse.Add(sub.layer1Members)


            //layerAndResponse.Append("Layer1");
            //for (int i = 0; i < 1; i++)
            //{
            //  layerAndResponse.Append("Layer1Response");
            //}

            //var suggestionPathObj = new SuggestionPaths();
            // sendResponse.layer = suggestionPathObj.NextLayer("Layer1");
            //sendResponse.layerMembers = suggestionPathObj.LayerMembers("Layer1Response");
            //sendResponse.choiceList.Append(layerAndResponse);

            //return sendResponse;

            //sendResponse.layerMembers.Add(layerAndResponse);
            //return layerAndResponse;
        }
예제 #2
0
        public List <string> GetSampleRequestResponse(string receivedresponse1, string receivedresponse2)
        {
            var sendResponse = new RequestResponse();
            //var layerAndResponse = new string[] { };
            var layerAndResponse = new List <string[]>();

            SuggestionPaths sub = new SuggestionPaths();

            if (sub.checkvalid(receivedresponse1, receivedresponse2))
            {
                var list = sub.NextLayer(receivedresponse2);
                return(list);
            }
            else
            {
                var response = new List <string>()
                {
                    "Invalid"
                };
                return(response);
            }
            // layerAndResponse.Add(sub.layer1Members)


            //layerAndResponse.Append("Layer1");
            //for (int i = 0; i < 1; i++)
            //{
            //  layerAndResponse.Append("Layer1Response");
            //}

            //var suggestionPathObj = new SuggestionPaths();
            // sendResponse.layer = suggestionPathObj.NextLayer("Layer1");
            //sendResponse.layerMembers = suggestionPathObj.LayerMembers("Layer1Response");
            //sendResponse.choiceList.Append(layerAndResponse);

            //return sendResponse;

            //sendResponse.layerMembers.Add(layerAndResponse);
            //return layerAndResponse;
        }