gdapi.Resource.hasLink C# (CSharp) Метод

hasLink() публичный Метод

Determins if a Resource currently has a link.
public hasLink ( string name ) : bool
name string Link to check
Результат bool
        public bool hasLink(string name)
        {
            return this.links.ContainsKey(name);
        }

Usage Example

Пример #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::hasLink