gdapi.Resource.hasProperty C# (CSharp) Method

hasProperty() public method

public hasProperty ( string propertyName ) : bool
propertyName string
return bool
        public bool hasProperty(string propertyName)
        {
            return m_dProperties.ContainsKey(propertyName);
        }

Usage Example

示例#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));
     }
 }
All Usage Examples Of gdapi.Resource::hasProperty