예제 #1
0
        // api/WowPvpLadderController/getpvpladder/
        private async Task ExecuteGetPvpLadderMethodAsync()
        {
            var    queryModel = new WowLadderQueryModel(QueryStringParsed);
            string jsonResult = await _wowPvpLadderController.GetPvpLadder(queryModel);

            SendJsonResult(jsonResult);
        }
예제 #2
0
        public async Task <string> GetPvpLadder(WowLadderQueryModel queryModel)
        {
            if (queryModel == null)
            {
                throw new ArgumentNullException(nameof(queryModel));
            }

            try
            {
                IReadOnlyList <PvpApiRowModel> rows = await _wowLadderRepository.GetAsync(
                    queryModel.Locale,
                    queryModel.PvpBracket,
                    queryModel.WowClass,
                    queryModel.WowSpecId);

                return(rows.ToJson());
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(ex));
            }
        }