예제 #1
0
        public IHttpActionResult GetOwMatchFilter(int PlayerID, [FromUri] DotaFilter filter)
        {
            Player p = db.Gamers.Find(PlayerID);

            if (p == null)
            {
                return(BadRequest("Jogador que requisitou o match não consta no banco"));
            }

            List <string>     dotaIDs = new List <string>();
            List <int>        halfIDS = new List <int>();
            List <DotaPlayer> ret     = new List <DotaPlayer>();

            foreach (var pg in db.PlayerGames.Where(x => x.IDGamer != PlayerID && x.IDGame == (int)Games.Dota))
            {
                halfIDS.Add(pg.IDGamer);
                dotaIDs.Add(pg.IdAPI);
            }

            var dp = DotaAPI.GetPlayers(dotaIDs, halfIDS).Where(x => x != null && filterDota(x, filter));

            if (dp == null)
            {
                NotFound();
            }

            return(Ok(dp));
        }
예제 #2
0
        public IHttpActionResult GetPlayers()
        {
            var pg = db.PlayerGames.Where(x => x.IDGame == (int)Games.Dota);

            if (pg == null)
            {
                return(NotFound());
            }
            var a = DotaAPI.GetPlayers(pg.Select(x => x.IdAPI).ToList(), pg.Select(x => x.IDGamer).ToList());

            return(Ok(a));
        }