Beispiel #1
0
        protected async Task <T> GetVerbAsync <T>(verbType verbType, string format = null, string set = null, DateTime?from = null,
                                                  DateTime?until = null)
        {
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            queryString.Add(Verb, verbType.ToString());

            if (!string.IsNullOrEmpty(format))
            {
                queryString.Add(MetadataPrefix, format);
            }

            if (!string.IsNullOrEmpty(format))
            {
                queryString.Add(Set, set);
            }

            if (from.HasValue)
            {
                queryString.Add(From, from.Value.ToString(m_granularityFormat));
            }

            if (until.HasValue)
            {
                queryString.Add(Until, until.Value.ToString(m_granularityFormat));
            }

            return((T)(await GetResponseAsync(queryString.ToString())).Items.First());
        }
Beispiel #2
0
        protected async Task <T> GetResumptionTokenAsync <T>(verbType verbType, string resumptionToken)
        {
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            queryString.Add(Verb, verbType.ToString());

            if (!string.IsNullOrEmpty(resumptionToken))
            {
                queryString.Add(ResumptionToken, resumptionToken);
            }

            return((T)(await GetResponseAsync(queryString.ToString())).Items.First());
        }