• DataStax C# Driver for Apache Cassandra API Documentation

    Show / Hide Table of Contents
    • Cassandra
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CustomColumnInfo
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DCAwareRoundRobinPolicy
      • DecimalTypeAdapter
      • DefaultLoadBalancingPolicy
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthenticator
      • IAuthProvider
      • IAuthProviderNamed
      • ICluster
      • IColumnInfo
      • IdempotenceAwareRetryPolicy
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InitFatalErrorException
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRetryPolicy
      • IsBootstrappingException
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • KeyspaceMetadata
      • KeyType
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoneAuthProvider
      • NoSpeculativeExecutionPolicy
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PreparedQueryNotFoundException
      • PreparedStatement
      • PreparedStatementIdMismatchException
      • ProtocolErrorException
      • ProtocolOptions
      • ProtocolVersion
      • QueryExecutionException
      • QueryOptions
      • QueryProtocolOptions
      • QueryProtocolOptions.QueryFlags
      • QueryTimeoutException
      • QueryTrace
      • QueryTrace.Event
      • QueryValidationException
      • ReadFailureException
      • ReadTimeoutException
      • RegularStatement
      • ReplicationStrategies
      • RequestInvalidException
      • RetryDecision
      • RetryDecision.RetryDecisionType
      • RetryLoadBalancingPolicy
      • RetryLoadBalancingPolicyEventArgs
      • RoundRobinPolicy
      • RoutingKey
      • Row
      • RowSet
      • RowSetMetadata
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • SSLOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • TokenAwarePolicy
      • ToManyConnectionsPerHost
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • WriteFailureException
      • WriteTimeoutException
    • Cassandra.AppMetrics
      • DriverAppMetricsOptions
    • Cassandra.AppMetrics.MetricTypes
      • IAppMetricsCounter
      • IAppMetricsGauge
      • IAppMetricsMeter
      • IAppMetricsMetric
      • IAppMetricsTimer
    • Cassandra.AppMetrics.MetricValues
      • IAppMetricsHistogramValue
      • IAppMetricsMeterValue
      • IAppMetricsMetricWithValue<T>
      • IAppMetricsTimerValue
    • Cassandra.Data
      • CqlBatchTransaction
      • CqlCommand
      • CqlConnection
      • CqlDataAdapter
      • CqlParameter
      • CqlParameterCollection
      • CqlProviderFactory
      • CqlReader
    • Cassandra.Data.Linq
      • AllowFilteringAttribute
      • Batch
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CompactStorageAttribute
      • CounterAttribute
      • CqlArgumentException
      • CqlCommand
      • CqlConditionalCommand<TEntity>
      • CqlDelete
      • CqlFunction
      • CqlInsert<TEntity>
      • CqlLinqNotSupportedException
      • CqlOperator
      • CqlQuery<TEntity>
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • IgnoreAttribute
      • ITable
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • Table<TEntity>
      • TableAttribute
      • TableType
    • Cassandra.DataStax.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Cassandra.DataStax.Auth.Sspi
      • SspiException
    • Cassandra.DataStax.Graph
      • Edge
      • Element
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • Vertex
    • Cassandra.DataStax.Search
      • DateRange
      • DateRangeBound
      • DateRangePrecision
    • Cassandra.Geometry
      • GeometryBase
      • LineString
      • Point
      • Polygon
    • Cassandra.Mapping
      • AppliedInfo<T>
      • ColumnMap
      • Cql
      • CqlQueryOptions
      • IColumnDefinition
      • ICqlBatch
      • ICqlQueryAsyncClient
      • ICqlQueryClient
      • ICqlWriteAsyncClient
      • ICqlWriteClient
      • IMapper
      • IPage<T>
      • ITypeDefinition
      • Map<TPoco>
      • Mapper
      • MappingConfiguration
      • Mappings
      • PrimaryKeyAttribute
      • SortOrder
      • TableNameAttribute
    • Cassandra.Mapping.Attributes
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CounterAttribute
      • FrozenAttribute
      • FrozenKeyAttribute
      • FrozenValueAttribute
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • StaticColumnAttribute
      • TableAttribute
    • Cassandra.Mapping.TypeConversion
      • DefaultTypeConverter
      • EnumStringMapper<T>
      • NullableEnumStringMapper<T>
      • TypeConverter
    • Cassandra.Mapping.Utils
      • MemberInfoExtensions
    • Cassandra.Metrics
      • DriverMetricsOptions
      • IDriverMetrics
      • IMetric
      • IMetricsRegistry<TMetric>
      • NodeMetric
      • NodeMetric.Counters
      • NodeMetric.Gauges
      • NodeMetric.Meters
      • NodeMetric.Timers
      • SessionMetric
      • SessionMetric.Counters
      • SessionMetric.Gauges
      • SessionMetric.Meters
      • SessionMetric.Timers
    • Cassandra.Metrics.Abstractions
      • IDriverCounter
      • IDriverGauge
      • IDriverMeter
      • IDriverMetric
      • IDriverMetricsProvider
      • IDriverTimer
    • Cassandra.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializer<T>
      • TypeSerializerDefinitions
      • UdtSerializer
    • Cassandra.Serialization.Primitive
      • DecimalSerializer

    Class GraphNode

    Represents an item of a graph query result, it can be a vertex, an edge, a path or an scalar value.

    Inheritance
    System.Object
    System.Dynamic.DynamicObject
    GraphNode
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    System.IEquatable<GraphNode>
    IGraphNode
    System.IEquatable<IGraphNode>
    System.Runtime.Serialization.ISerializable
    Inherited Members
    System.Dynamic.DynamicObject.GetDynamicMemberNames()
    System.Dynamic.DynamicObject.GetMetaObject(System.Linq.Expressions.Expression)
    System.Dynamic.DynamicObject.TryBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Object, System.Object)
    System.Dynamic.DynamicObject.TryCreateInstance(System.Dynamic.CreateInstanceBinder, System.Object[], System.Object)
    System.Dynamic.DynamicObject.TryDeleteIndex(System.Dynamic.DeleteIndexBinder, System.Object[])
    System.Dynamic.DynamicObject.TryDeleteMember(System.Dynamic.DeleteMemberBinder)
    System.Dynamic.DynamicObject.TryGetIndex(System.Dynamic.GetIndexBinder, System.Object[], System.Object)
    System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
    System.Dynamic.DynamicObject.TryInvokeMember(System.Dynamic.InvokeMemberBinder, System.Object[], System.Object)
    System.Dynamic.DynamicObject.TrySetIndex(System.Dynamic.SetIndexBinder, System.Object[], System.Object)
    System.Dynamic.DynamicObject.TrySetMember(System.Dynamic.SetMemberBinder, System.Object)
    System.Dynamic.DynamicObject.TryUnaryOperation(System.Dynamic.UnaryOperationBinder, System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Cassandra.DataStax.Graph
    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
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context

    GraphNode(String)

    Creates a new instance of GraphNode.

    Declaration
    public GraphNode(string json)
    Parameters
    Type Name Description
    System.String json

    The graph string json with the form: "{&quot;result&quot;: ...}".

    Properties

    IsArray

    Returns true if the underlying value is an array.

    Declaration
    public bool IsArray { get; }
    Property Value
    Type Description
    System.Boolean

    IsObjectTree

    Returns true if the underlying value is an object tree.

    Declaration
    public bool IsObjectTree { get; }
    Property Value
    Type Description
    System.Boolean

    IsScalar

    Returns true if the underlying value is a scalar value (string, double, boolean, ...).

    Declaration
    public bool IsScalar { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Equals(GraphNode)

    Returns true if the value represented by this instance is the same.

    Declaration
    public bool Equals(GraphNode other)
    Parameters
    Type Name Description
    GraphNode other
    Returns
    Type Description
    System.Boolean

    Equals(IGraphNode)

    Declaration
    public bool Equals(IGraphNode other)
    Parameters
    Type Name Description
    IGraphNode other
    Returns
    Type Description
    System.Boolean

    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
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)

    Get<T>(String)

    Gets the typed value of a property of the result.

    Declaration
    public T Get<T>(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the property.

    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Type of the property. Use dynamic for object trees.

    Exceptions
    Type Condition
    System.NotSupportedException

    Throws NotSupportedException when the target type is not supported

    GetHashCode()

    Gets the hash code for this instance, based on its value.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    GetObjectData(SerializationInfo, StreamingContext)

    Declaration
    public void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context

    GetProperties()

    Gets the a dictionary of properties of this node.

    Declaration
    public IDictionary<string, GraphNode> GetProperties()
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, GraphNode>

    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
    public dynamic GetRaw()
    Returns
    Type Description
    System.Object

    HasProperty(String)

    Returns true if the property is defined in this instance.

    Declaration
    public bool HasProperty(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Boolean
    Exceptions
    Type Condition
    System.InvalidOperationException

    When the underlying value is not an object tree

    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
    System.Type type
    Returns
    Type Description
    System.Object
    Exceptions
    Type Condition
    System.NotSupportedException

    Throws NotSupportedException when the target type is not supported

    To<T>()

    Returns the representation of the GraphNode as an instance of type T.

    Declaration
    public T To<T>()
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    The type to which the current instance is going to be converted to.

    Exceptions
    Type Condition
    System.NotSupportedException

    Throws NotSupportedException when the target type is not supported

    ToArray()

    Converts the instance into an array when the internal representation is a json array.

    Declaration
    public GraphNode[] ToArray()
    Returns
    Type Description
    GraphNode[]

    ToBoolean()

    Returns the representation of the result as a boolean.

    Declaration
    public bool ToBoolean()
    Returns
    Type Description
    System.Boolean
    Exceptions
    Type Condition
    System.InvalidOperationException

    It throws an InvalidOperationException when the internal value is not an scalar.

    System.InvalidCastException

    When the scalar value is not convertible to target type.

    ToDouble()

    Returns the representation of the result as a double.

    Declaration
    public double ToDouble()
    Returns
    Type Description
    System.Double
    Exceptions
    Type Condition
    System.InvalidOperationException

    It throws an InvalidOperationException when the internal value is not an scalar.

    System.InvalidCastException

    When the scalar value is not convertible to target type.

    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
    public Edge ToEdge()
    Returns
    Type Description
    Edge

    ToIArray()

    Converts the instance into an array when the internal representation is a json array.

    Declaration
    public IGraphNode[] ToIArray()
    Returns
    Type Description
    IGraphNode[]

    ToInt32()

    Returns the representation of the result as an int.

    Declaration
    public int ToInt32()
    Returns
    Type Description
    System.Int32
    Exceptions
    Type Condition
    System.InvalidOperationException

    It throws an InvalidOperationException when the internal value is not an scalar.

    System.InvalidCastException

    When the scalar value is not convertible to target type.

    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
    public Path ToPath()
    Returns
    Type Description
    Path

    ToString()

    Returns the json representation of the result.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    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
    public Vertex ToVertex()
    Returns
    Type Description
    Vertex

    TryConvert(ConvertBinder, out Object)

    Declaration
    public override bool TryConvert(ConvertBinder binder, out object result)
    Parameters
    Type Name Description
    System.Dynamic.ConvertBinder binder
    System.Object result
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Dynamic.DynamicObject.TryConvert(System.Dynamic.ConvertBinder, System.Object)

    TryGetMember(GetMemberBinder, out Object)

    Provides the implementation for operations that get member values.

    Declaration
    public override bool TryGetMember(GetMemberBinder binder, out object result)
    Parameters
    Type Name Description
    System.Dynamic.GetMemberBinder binder
    System.Object result
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Dynamic.DynamicObject.TryGetMember(System.Dynamic.GetMemberBinder, System.Object)

    Operators

    Equality(GraphNode, GraphNode)

    Returns true if the value represented by the instances are the same.

    Declaration
    public static bool operator ==(GraphNode result1, GraphNode result2)
    Parameters
    Type Name Description
    GraphNode result1
    GraphNode result2
    Returns
    Type Description
    System.Boolean

    Implicit(GraphNode to Edge)

    Converts this instance to an Edge instance.

    Declaration
    public static implicit operator Edge(GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    Edge

    Implicit(GraphNode to Path)

    Converts this instance to a Path instance.

    Declaration
    public static implicit operator Path(GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    Path

    Implicit(GraphNode to Vertex)

    Converts this instance to a Vertex instance.

    Declaration
    public static implicit operator Vertex(GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    Vertex

    Implicit(GraphNode to Boolean)

    Converts this instance to a boolean representation.

    Declaration
    public static implicit operator bool (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Boolean

    Implicit(GraphNode to Double)

    Converts this instance to a long representation.

    Declaration
    public static implicit operator double (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Double

    Implicit(GraphNode to Int16)

    Converts this instance to a short representation.

    Declaration
    public static implicit operator short (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Int16

    Implicit(GraphNode to Int32)

    Converts this instance to an int representation.

    Declaration
    public static implicit operator int (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Int32

    Implicit(GraphNode to Int64)

    Converts this instance to a long representation.

    Declaration
    public static implicit operator long (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Int64

    Implicit(GraphNode to Single)

    Converts this instance to a float representation.

    Declaration
    public static implicit operator float (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.Single

    Implicit(GraphNode to String)

    Converts this instance to a string representation.

    Declaration
    public static implicit operator string (GraphNode b)
    Parameters
    Type Name Description
    GraphNode b
    Returns
    Type Description
    System.String

    Inequality(GraphNode, GraphNode)

    Compares the values for inequality.

    Declaration
    public static bool operator !=(GraphNode result1, GraphNode result2)
    Parameters
    Type Name Description
    GraphNode result1
    GraphNode result2
    Returns
    Type Description
    System.Boolean

    Explicit Interface Implementations

    IGraphNode.GetProperties()

    Declaration
    IDictionary<string, IGraphNode> IGraphNode.GetProperties()
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, IGraphNode>

    Implements

    System.Dynamic.IDynamicMetaObjectProvider
    System.IEquatable<T>
    IGraphNode
    System.IEquatable<T>
    System.Runtime.Serialization.ISerializable
    Back to top © DataStax, All rights reserved.