Exemple #1
0
        public async Task <WallGetResponse> GetAsync(QueryParameters parameters, CancellationToken ct, bool ignoraCache = false)
        {
            var response = ignoraCache
            ? await _api.ExecuteMethodIgnoreCacheAsync("wall.get", parameters, ct).ConfigureAwait(false)
            : await _api.ExecuteMethodAsync("wall.get", parameters, ct).ConfigureAwait(false);

            return(JsonConvert.DeserializeObject <WallGetResponse>(response));
        }
Exemple #2
0
        //public async Task<WallPostResponse> PostAsync(int wallId, string message, int date, [NotNull] Attachments attachments) {
        //   if (attachments == null) throw new ArgumentNullException(nameof(attachments));

        //   var parameters = makeAQuery(wallId, message, date, attachments);
        //   var result = await postAsync(parameters, CancellationToken.None);

        //   OnPostSuccessful(new WallPostInfo{
        //      WallId = wallId,
        //      Message = message,
        //      Date = date,
        //      Attachments = attachments,
        //      Postponed = true,
        //      PublishingDate = UnixTimeConverter.ToUnix(DateTimeOffset.Now.DateTime)
        //   });

        //   return result;
        //}

        private async Task <WallPostResponse> postAsync(QueryParameters parameters, CancellationToken ct)
        {
            var response = await _api.ExecuteMethodIgnoreCacheAsync("wall.post", parameters, ct).ConfigureAwait(false);

            return(JsonConvert.DeserializeObject <WallPostResponse>(response));
        }