示例#1
0
        /// <summary>
        /// Returns items list for a community.
        /// Docs: <see href="https://vk.com/dev/market.get">market.get</see>
        /// </summary>
        /// <param name="ownerId">
        /// ID of an item owner community; "Note that community id in the 'owner_id' parameter should be
        /// negative number. For example 'owner_id'=-1 matches the VK API community "
        /// </param>
        /// <param name="count">Number of items to return.</param>
        /// <param name="offset">Offset needed to return a specific subset of results.</param>
        /// <param name="extended">
        /// '1' – method will return additional fields: 'likes, can_comment, car_repost, photos'. These
        /// parameters are not returned by default.
        /// </param>
        public Task <ApiItemsResponse <MarketItem> > Get(int?ownerId   = null, int?count = null, int?offset = null,
                                                         bool?extended = null)
        {
            var parameters = new Dictionary <string, string>();

            if (ownerId != null)
            {
                parameters.Add("owner_id", ownerId.ToApiString());
            }
            if (count != null)
            {
                parameters.Add("count", count.ToApiString());
            }
            if (offset != null)
            {
                parameters.Add("offset", offset.ToApiString());
            }
            if (extended != null)
            {
                parameters.Add("extended", extended.ToApiString());
            }

            return(_vkontakte.RequestAsync <ApiItemsResponse <MarketItem> >("market.get", parameters));
        }