コード例 #1
0
        /// <summary>
        /// Delete a relationship from the current user by the relation's user id.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="relationshipType">The relationship type.</param>
        /// <returns>The <see cref="Task"/>.</returns>
        public async Task DeleteById(long userId, RelationshipType relationshipType)
        {
            var query = new RelationshipQuery(null, relationshipType);
            var url   = this.GetFinalUrl(string.Format("{0}/{1}.json", Endpoints.Relationships, userId), query.SerializeQueryString());

            await this.Client.DeleteAsync(url);
        }
コード例 #2
0
        /// <summary>
        /// Get other user's relationship by their id.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The <see cref="RelationshipEnvelope"/>.</returns>
        public async Task<RelationshipEnvelope> GetById(long userId)
        {
            var query = new RelationshipQuery(userId, null);
            var url = this.GetFinalUrl(string.Format("{0}.json", Endpoints.Relationships), query.SerializeQueryString());
            var result = await this.Client.GetAsync<RelationshipEnvelope>(url);

            return result.Content;
        }
コード例 #3
0
        /// <summary>
        /// Get other user's relationship by their id.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The <see cref="RelationshipEnvelope"/>.</returns>
        public async Task <RelationshipEnvelope> GetById(long userId)
        {
            var query  = new RelationshipQuery(userId, null);
            var url    = this.GetFinalUrl(string.Format("{0}.json", Endpoints.Relationships), query.SerializeQueryString());
            var result = await this.Client.GetAsync <RelationshipEnvelope>(url);

            return(result.Content);
        }
コード例 #4
0
        /// <summary>
        /// Delete a relationship from the current user by the relation's user id.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="relationshipType">The relationship type.</param>
        /// <returns>The <see cref="Task"/>.</returns>
        public async Task DeleteById(long userId, RelationshipType relationshipType)
        {
            var query = new RelationshipQuery(null, relationshipType);
            var url = this.GetFinalUrl(string.Format("{0}/{1}.json", Endpoints.Relationships, userId), query.SerializeQueryString());

            await this.Client.DeleteAsync(url);
        }