コード例 #1
0
        public async Task <Option <PopulatedPlayer> > GetPlayerByPlayerIdAsync(long id)
        {
            await UpdateStackables();

            return(Option.Some(
                       await requester.Request <PopulatedPlayer>(
                           builder.Build(EndPoints.SinglePlayer + id),
                           jsonApiSerializerSettings)));
        }
コード例 #2
0
        public async Task <DTOs.Matches.Match> GetMatchAsync(string id)
        {
            var request
                = await requester.Request <DTOs.Matches.Match>(
                      builder.Build(
                          EndPoints.SingleMatch + id,
                          new List <IParameter>()),
                      jsonSerializerSettings);

            return(request);
        }
コード例 #3
0
        public WeatherReport QueryForecast(WeatherRequest request)
        {
            var url  = string.Format(URL, request.City, _apiKey);
            var json = _requester.Request(url);

            return(new WeatherReport
            {
                City = request.City,
                JSON = json,
                Date = DateTime.Now
            });
        }
コード例 #4
0
        /// <summary>Sends the specified packet to Sentry.</summary>
        /// <param name="packet">The packet to send.</param>
        /// <returns>
        /// The <see cref="JsonPacket.EventID" /> of the successfully captured JSON packet, or <c>null</c> if it fails.
        /// </returns>
        protected virtual string Send(JsonPacket packet)
        {
            IRequester requester = null;

            try
            {
                requester = CreateRequester(packet);

                if (BeforeSend != null)
                {
                    requester = BeforeSend(requester);
                }

                return(requester.Request());
            }
            catch (Exception exception)
            {
                return(HandleException(exception, requester));
            }
        }