Esempio n. 1
0
        public List <ResponseShortUrlViewModel_TopTen> GetTopTen()
        {
            string    sql = string.Empty;
            dbAccess  db  = new dbAccess();
            DataTable dt  = new DataTable();

            List <ResponseShortUrlViewModel_TopTen> tt = new List <ResponseShortUrlViewModel_TopTen>();

            sql += "SELECT Top 10 ShortURL, count(*) as qtdAccess ";
            sql += "FROM tblShortURL_Access ";
            sql += "group by ShortURL ";
            sql += "order by qtdAccess desc ";

            string ret = db.DataTableToJSON(db.SelectAccessDBSqlServer(sql, _configuration.GetConnectionString("DefaultConnection").ToString()));

            var o = JsonConvert.DeserializeObject <List <ResponseShortUrlViewModel_TopTen> >(ret);

            return(o);
        }