Пример #1
0
 public string AddHashTag(string query, int countofpages)
 {
     try
     {
         DBWorker   dbworker = new DBWorker();
         Pagination p        = dbworker.GetPaginations(query);
         if (p != null)
         {
             return("tagexists");
         }
         return(JsonConvert.SerializeObject(Cashing.Cash(query, countofpages)));
     }
     catch
     {
         return("badbd");
     }
 }
Пример #2
0
        public string Search(string query)
        {
            DBWorker           dbworker = new DBWorker();
            List <GeneralPost> posts    = dbworker.GetAllPostsByHashTag(query);

            if (posts.Count != 0)
            {
                Pagination   pag = dbworker.GetPaginations(query);
                SearchResult res = new SearchResult();
                res.Posts             = posts;
                res.InstPagination    = pag.InstagrammPagination;
                res.VKPagination      = pag.VKPagination;
                res.TwitterPagination = pag.TwitterPagination;
                res.Query             = query;
                return(JsonConvert.SerializeObject(res));
            }

            AggregatorModel aggregator = new AggregatorModel();

            return(JsonConvert.SerializeObject(aggregator.Search(query)));
        }