Ejemplo n.º 1
0
        public async Task <ActionResult> GetCountry(string inputData)
        {
            if (!inputData.Substring(0).Contains(delimiter))
            {
                return(BadRequest("Invalid data. Data must contain '|'"));
            }
            List <string> data           = inputData.Split(delimiter).ToList();
            List <string> formatDataList = new List <string>();

            if (data.Count > 1)
            {
                List <Definition> rules = DefinitionService.GetAll();



                foreach (var rule in rules)
                {
                    data.ForEach(r => formatDataList.Add(r.Replace(rule.Target, rule.Replace)));
                }
            }

            var result = await DataService.GetData(formatDataList);

            return(Ok(result));
        }
Ejemplo n.º 2
0
 public ActionResult GetAll()
 {
     return(Ok(DefinitionService.GetAll()));
 }