private static Dictionary <string, object> ConvertToQuery(NodeRef nodeRef) { Dictionary <string, object> query = nodeRef.Parts .ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value); query["nodeType"] = nodeRef.NodeType; return(query); }
public override int GetHashCode() { unchecked { int hashCode = (NodeRef != null ? NodeRef.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsDeleted.GetHashCode(); hashCode = (hashCode * 397) ^ CreationTime.GetHashCode(); hashCode = (hashCode * 397) ^ ModificationTime.GetHashCode(); hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Removes a node with the specified reference. /// </summary> /// <param name="nodeRef">The node reference to look for.</param> public void Remove(NodeRef nodeRef) { _api.HttpHelper.Delete(_nodesUri, ConvertToQuery(nodeRef)); }
/// <summary> /// Gets a node with the specified reference. /// </summary> /// <param name="nodeRef">The node reference to look for.</param> /// <returns> /// A node with the specified reference. /// </returns> public Node Get(NodeRef nodeRef) { return(_api.HttpHelper.Get <Node>(_nodesUri, ConvertToQuery(nodeRef))); }