Exemplo n.º 1
0
 public HttpResponseMessage Search(string query, string searchType)
 {
     try
     {//Need to use DI
         var searchHelper = new SearchHelper();
         var list = searchHelper.LocateClient(query, searchType);
         var totalPossible = searchHelper.CountClient(query, searchType);
         var listOfWords = searchHelper.GetWordList(query, searchType);
         return CreateResponse(list, totalPossible, listOfWords);
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(HandleExcpetion(ex));
     }
 }
Exemplo n.º 2
0
        public HttpResponseMessage SearchByPeice(string name, string phone, string address, string policy)
        {
            try
            {
                //Need to use DI
                var searchHelper = new SearchHelper();
                var list = searchHelper.LocateClient(name, phone, address, policy);
                var totalPossible = searchHelper.CountClient(name, phone, address, policy);

                var listOfWords = new List<string>() {"NA"};
                //var listOfWords = searchHelper.GetWordList(name);
                return CreateResponse(list, totalPossible, listOfWords);
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(HandleExcpetion(ex));
            }
        }