Exemple #1
0
        public IActionResult Get()
        {
            string   id    = Request.Query["ItemId"];
            ICache   cache = new ICache();
            DBAction db    = new DBAction();
            int      res   = (int)cache.GetZsetValue("score", id);
            ItemItem item  = new ItemItem();

            try
            {
                item.ItemId = uint.Parse(id);
                db.GetItemInfo(uint.Parse(id), ref item);
            }
            catch
            {
                return(BadRequest());
            }
            item.Score = res;
            var json = JObject.FromObject(item);

            return(new ObjectResult(json));
        }