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

public hasProperty ( string propertyName ) : bool
propertyName string
Результат bool
Пример #1
0
 /// <summary>
 /// Saves a Resource
 /// </summary>
 /// <param name="collectionType">Collection type to save the resource to</param>
 /// <param name="resource">Resource to save</param>
 /// <returns>Saved Resource</returns>
 public Resource save(string collectionType, Resource resource)
 {
     if (resource.hasProperty("id"))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("PUT");
         rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
         rRequestor.setQuery(collectionType + "/" + resource.getProperty("id"));
         return(getResourceByRequest(rRequestor));
     }
     else
     {
         return(create(collectionType, resource));
     }
 }
Пример #2
0
 /// <summary>
 /// Saves a Resource
 /// </summary>
 /// <param name="collectionType">Collection type to save the resource to</param>
 /// <param name="resource">Resource to save</param>
 /// <returns>Saved Resource</returns>
 public Resource save(string collectionType, Resource resource)
 {
     if (resource.hasProperty("id"))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("PUT");
         rRequestor.setBody(JsonConvert.SerializeObject(resource.getProperties()));
         rRequestor.setQuery(collectionType + "/" + resource.getProperty("id"));
         return getResourceByRequest(rRequestor);
     }
     else
     {
         return create(collectionType, resource);
     }
 }