public int GetExtended(long ownerId, out ReadOnlyCollection<Post> wallPosts, out ReadOnlyCollection<User> profiles, out ReadOnlyCollection<Group> groups, int? count = null, int? offset = null, WallFilter filter = WallFilter.All) { VkErrors.ThrowIfNumberIsNegative(() => count); VkErrors.ThrowIfNumberIsNegative(() => offset); if (filter == WallFilter.Suggests && ownerId >= 0) throw new ArgumentException("OwnerID must be negative in case filter equal to Suggests", "ownerId"); var parameters = new VkParameters { { "owner_id", ownerId }, { "count", count }, { "offset", offset }, { "filter", filter.ToString().ToLowerInvariant() }, {"extended", 1} }; var response = _vk.Call("wall.get", parameters); wallPosts = response["items"].ToReadOnlyCollectionOf<Post>(r => r); profiles = response["profiles"].ToReadOnlyCollectionOf<User>(r => r); groups = response["groups"].ToReadOnlyCollectionOf<Group>(r => r); return response["count"]; }
public ReadOnlyCollection<Post> Get(long ownerId, out int totalCount, int? count = null, int? offset = null, WallFilter filter = WallFilter.All) { VkErrors.ThrowIfNumberIsNegative(() => count); VkErrors.ThrowIfNumberIsNegative(() => offset); if (filter == WallFilter.Suggests && ownerId >= 0) throw new ArgumentException("OwnerID must be negative in case filter equal to Suggests", "ownerId"); var parameters = new VkParameters { { "owner_id", ownerId }, { "count", count }, { "offset", offset }, { "filter", filter.ToString().ToLowerInvariant() } }; VkResponse response = _vk.Call("wall.get", parameters); totalCount = response["count"]; VkResponseArray items = response["items"]; return items.ToReadOnlyCollectionOf<Post>(r => r); }
public int GetExtended(long ownerId, out ReadOnlyCollection <Post> wallPosts, out ReadOnlyCollection <User> profiles, out ReadOnlyCollection <Group> groups, int?count = null, int?offset = null, WallFilter filter = WallFilter.All) { VkErrors.ThrowIfNumberIsNegative(() => count); VkErrors.ThrowIfNumberIsNegative(() => offset); if (filter == WallFilter.Suggests && ownerId >= 0) { throw new ArgumentException("OwnerID must be negative in case filter equal to Suggests", "ownerId"); } var parameters = new VkParameters { { "owner_id", ownerId }, { "count", count }, { "offset", offset }, { "filter", filter.ToString().ToLowerInvariant() }, { "extended", 1 } }; var response = _vk.Call("wall.get", parameters); wallPosts = response["items"].ToReadOnlyCollectionOf <Post>(r => r); profiles = response["profiles"].ToReadOnlyCollectionOf <User>(r => r); groups = response["groups"].ToReadOnlyCollectionOf <Group>(r => r); return(response["count"]); }
public ReadOnlyCollection <Post> Get(long ownerId, out int totalCount, int?count = null, int?offset = null, WallFilter filter = WallFilter.All) { VkErrors.ThrowIfNumberIsNegative(() => count); VkErrors.ThrowIfNumberIsNegative(() => offset); if (filter == WallFilter.Suggests && ownerId >= 0) { throw new ArgumentException("OwnerID must be negative in case filter equal to Suggests", "ownerId"); } var parameters = new VkParameters { { "owner_id", ownerId }, { "count", count }, { "offset", offset }, { "filter", filter.ToString().ToLowerInvariant() } }; VkResponse response = _vk.Call("wall.get", parameters); totalCount = response["count"]; VkResponseArray items = response["items"]; return(items.ToReadOnlyCollectionOf <Post>(r => r)); }