/// <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); } }
/// <summary> /// Fetches a link from the API as a Resource. /// </summary> /// <param name="resource">Resource object which contains links.</param> /// <param name="linkName">Link name to return.</param> /// <exception cref="NotFoundException"/> /// <returns>Resource from Resource</returns> public Resource fetchLinkAsResource(Resource resource, string linkName) { if (resource.hasLink(linkName)) { gdapi.WebRequest rRequestor = new gdapi.WebRequest(this); rRequestor.setType("GET"); rRequestor.setUrl(resource.getLink(linkName)); return getResourceByRequest(rRequestor); } else { return null; } }