gdapi.Resource.getLink C# (CSharp) Method

getLink() public method

Gets the current link if it exists.
public getLink ( string name ) : string
name string Link to fetch
return string
        public string getLink(string name)
        {
            return hasLink(name) ? this.links[name] : null;
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Fetches a link from the API as a Collection.
 /// </summary>
 /// <param name="resource">Resource object which contains links.</param>
 /// <param name="linkName">Link name to return.</param>
 /// <exception cref="NotFoundException"/>
 /// <returns>Collection from Resource</returns>
 public Collection fetchLinkAsCollection(Resource resource, string linkName)
 {
     if (resource.hasLink(linkName))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("GET");
         rRequestor.setUrl(resource.getLink(linkName));
         return(getCollectionByRequest(rRequestor));
     }
     else
     {
         return(null);
     }
 }
All Usage Examples Of gdapi.Resource::getLink