Class GraphNode
Represents an item of a graph query result, it can be a vertex, an edge, a path or an scalar value.
Assembly: Cassandra.dll
Syntax
[Serializable]
[JsonConverter(typeof(GraphNodeConverter))]
public class GraphNode : DynamicObject, IDynamicMetaObjectProvider, IEquatable<GraphNode>, IGraphNode, IEquatable<IGraphNode>, ISerializable
Constructors
GraphNode(SerializationInfo, StreamingContext)
Creates a new instance of GraphNode using a serialization information.
Declaration
protected GraphNode(SerializationInfo info, StreamingContext context)
Parameters
GraphNode(string)
Declaration
public GraphNode(string json)
Parameters
Type |
Name |
Description |
string |
json |
The graph string json with the form: "{"result": ...}".
|
Properties
IsArray
Returns true if the underlying value is an array.
Declaration
public bool IsArray { get; }
Property Value
IsObjectTree
Returns true if the underlying value is an object tree.
Declaration
public bool IsObjectTree { get; }
Property Value
IsScalar
Returns true if the underlying value is a scalar value (string, double, boolean, ...).
Declaration
public bool IsScalar { get; }
Property Value
Methods
Equals(GraphNode)
Returns true if the value represented by this instance is the same.
Declaration
public bool Equals(GraphNode other)
Parameters
Returns
Equals(IGraphNode)
Declaration
public bool Equals(IGraphNode other)
Parameters
Returns
Equals(object)
Returns true if the value represented by this instance is the same.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
GetHashCode()
Gets the hash code for this instance, based on its value.
Declaration
public override int GetHashCode()
Returns
Overrides
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
GetProperties()
Gets the a dictionary of properties of this node.
Declaration
public IDictionary<string, GraphNode> GetProperties()
Returns
GetRaw()
Gets the raw data represented by this instance.
Raw internal representation might be different depending on the graph serialization format and
it is subject to change without any prior notice.
Declaration
Returns
Get<T>(string)
Gets the typed value of a property of the result.
Declaration
public T Get<T>(string propertyName)
Parameters
Type |
Name |
Description |
string |
propertyName |
Name of the property.
|
Returns
Type Parameters
Name |
Description |
T |
Type of the property. Use dynamic for object trees.
|
Exceptions
HasProperty(string)
Returns true if the property is defined in this instance.
Declaration
public bool HasProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
Exceptions
To(Type)
Returns the representation of the GraphNode as an instance of the type provided.
Declaration
public object To(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
Exceptions
ToArray()
Converts the instance into an array when the internal representation is a json array.
Declaration
public GraphNode[] ToArray()
Returns
ToBoolean()
Returns the representation of the result as a boolean.
Declaration
Returns
Exceptions
ToDouble()
Returns the representation of the result as a double.
Declaration
Returns
Exceptions
ToEdge()
Returns an edge representation of the current instance.
This method is maintained for backward compatibity. It's recommended that you use
To<T>() instead, providing IEdge as type parameter
Declaration
Returns
ToFloat()
Returns the representation of the result as a float.
Declaration
Returns
Exceptions
ToIArray()
Converts the instance into an array when the internal representation is a json array.
Declaration
public IGraphNode[] ToIArray()
Returns
ToInt32()
Returns the representation of the result as an int.
Declaration
Returns
Exceptions
ToPath()
Returns a Path representation of the current instance.
This method is maintained for backward compatibity. It's recommended that you use
To<T>() instead, providing IPath as type parameter.
Declaration
Returns
ToString()
Returns the json representation of the result.
Declaration
public override string ToString()
Returns
Overrides
ToVertex()
Returns a vertex representation of the current instance.
This method is maintained for backward compatibity. It's recommended that you use
To<T>() instead, providing IVertex as type parameter.
Declaration
Returns
To<T>()
Returns the representation of the GraphNode as an instance of type T.
Declaration
Returns
Type Parameters
Name |
Description |
T |
The type to which the current instance is going to be converted to.
|
Exceptions
TryConvert(ConvertBinder, out object)
Declaration
public override bool TryConvert(ConvertBinder binder, out object result)
Parameters
Returns
Overrides
TryGetMember(GetMemberBinder, out object)
Provides the implementation for operations that get member values.
Declaration
public override bool TryGetMember(GetMemberBinder binder, out object result)
Parameters
Returns
Overrides
Operators
operator ==(GraphNode, GraphNode)
Returns true if the value represented by the instances are the same.
Declaration
public static bool operator ==(GraphNode result1, GraphNode result2)
Parameters
Returns
implicit operator Edge(GraphNode)
Converts this instance to an Edge instance.
Declaration
public static implicit operator Edge(GraphNode b)
Parameters
Returns
implicit operator Path(GraphNode)
Converts this instance to a Path instance.
Declaration
public static implicit operator Path(GraphNode b)
Parameters
Returns
implicit operator Vertex(GraphNode)
Converts this instance to a Vertex instance.
Declaration
public static implicit operator Vertex(GraphNode b)
Parameters
Returns
implicit operator bool(GraphNode)
Converts this instance to a boolean representation.
Declaration
public static implicit operator bool(GraphNode b)
Parameters
Returns
implicit operator double(GraphNode)
Converts this instance to a long representation.
Declaration
public static implicit operator double(GraphNode b)
Parameters
Returns
implicit operator short(GraphNode)
Converts this instance to a short representation.
Declaration
public static implicit operator short(GraphNode b)
Parameters
Returns
implicit operator int(GraphNode)
Converts this instance to an int representation.
Declaration
public static implicit operator int(GraphNode b)
Parameters
Returns
implicit operator long(GraphNode)
Converts this instance to a long representation.
Declaration
public static implicit operator long(GraphNode b)
Parameters
Returns
implicit operator float(GraphNode)
Converts this instance to a float representation.
Declaration
public static implicit operator float(GraphNode b)
Parameters
Returns
implicit operator string(GraphNode)
Converts this instance to a string representation.
Declaration
public static implicit operator string(GraphNode b)
Parameters
Returns
operator !=(GraphNode, GraphNode)
Compares the values for inequality.
Declaration
public static bool operator !=(GraphNode result1, GraphNode result2)
Parameters
Returns
Implements