• DataStax C# Driver for Apache Cassandra API Documentation
Search Results for

    Show / Hide Table of Contents
    • Cassandra
      • AesColumnEncryptionPolicy
      • AesColumnEncryptionPolicy.AesKeyAndIV
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BaseColumnEncryptionPolicy<TKey>
      • BaseColumnEncryptionPolicy<TKey>.ColMetadataKey
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnEncryptionInvalidTypeError
      • ColumnEncryptionMetadata
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CqlVector<T>
      • CustomColumnInfo
      • DCAwareRoundRobinPolicy
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DecimalTypeAdapter
      • DefaultLoadBalancingPolicy
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • EncryptedValue
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • GraphProtocol
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthProvider
      • IAuthenticator
      • ICluster
      • IColumnEncryptionPolicy
      • IColumnInfo
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRequestTracker
      • IRetryPolicy
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • IdempotenceAwareRetryPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InitFatalErrorException
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IsBootstrappingException
      • KeyType
      • KeyspaceMetadata
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoSpeculativeExecutionPolicy
      • NodeRequestInfo
      • NoneAuthProvider
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PrepareRequest
      • 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
      • SSLOptions
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SessionRequestInfo
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • ToManyConnectionsPerHost
      • TokenAwarePolicy
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • VectorColumnInfo
      • 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
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlQuery<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • ITable
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • TableAttribute
      • TableType
      • Table<TEntity>
    • Cassandra.DataStax.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Cassandra.DataStax.Auth.Sspi
      • SspiException
    • Cassandra.DataStax.Graph
      • Direction
      • Edge
      • Element
      • ElementMap
      • EnumWrapper
      • FluentGraphStatement
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IPropertyWithElement
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • TEnum
      • Traverser
      • Vertex
    • Cassandra.DataStax.Graph.Internal
      • IGraphSONDeserializer
      • IGraphSONReader
      • IGraphSONSerializer
      • IGraphSONWriter
    • 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.OpenTelemetry
      • BuilderExtensions
      • CassandraActivitySourceHelper
      • CassandraInstrumentationOptions
      • OpenTelemetryRequestTracker
    • Cassandra.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializerDefinitions
      • TypeSerializer<T>
      • UdtSerializer
    • Cassandra.Serialization.Primitive
      • DecimalSerializer

    Class CqlQueryExtensions

    Inheritance
    object
    CqlQueryExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Cassandra.Data.Linq
    Assembly: Cassandra.dll
    Syntax
    public static class CqlQueryExtensions

    Methods

    AllowFiltering<TSource>(CqlQuery<TSource>)

    The ALLOW FILTERING option allows to explicitly allow queries that require filtering. Please note that a query using ALLOW FILTERING may thus have unpredictable performance (for the definition above), i.e. even a query that selects a handful of records may exhibit performance that depends on the total amount of data stored in the cluster.

    Declaration
    public static CqlQuery<TSource> AllowFiltering<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Returns
    Type Description
    CqlQuery<TSource>
    Type Parameters
    Name Description
    TSource

    Count<TSource>(CqlQuery<TSource>)

    Returns the number of rows matching the query. To execute this CqlScalar use Execute() method.

    Declaration
    public static CqlScalar<long> Count<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to return the first element of.

    Returns
    Type Description
    CqlScalar<long>

    A single result: the number of rows matching the query.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    DeleteIf<TSource>(CqlQuery<TSource>, Expression<Func<TSource, bool>>)

    Returns a representation of a DELETE ... IF ... cql statement, for Lightweight Transactions support

    Declaration
    public static CqlConditionalCommand<TSource> DeleteIf<TSource>(this CqlQuery<TSource> source, Expression<Func<TSource, bool>> predicate)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Expression<Func<TSource, bool>> predicate
    Returns
    Type Description
    CqlConditionalCommand<TSource>
    Type Parameters
    Name Description
    TSource

    Delete<TSource>(CqlQuery<TSource>)

    Returns a representation of a DELETE cql statement

    Declaration
    public static CqlDelete Delete<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Returns
    Type Description
    CqlDelete
    Type Parameters
    Name Description
    TSource

    FirstOrDefault<TSource>(CqlQuery<TSource>)

    Returns a CqlQuery which after execution will return the first element of a sequence, or a default value if the sequence contains no elements. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuerySingleElement<TSource> FirstOrDefault<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to return the first element of.

    Returns
    Type Description
    CqlQuerySingleElement<TSource>

    a CqlQuery<TSource> which after execution will return default(TSource) if source is empty, otherwise the first element in source.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    FirstOrDefault<TSource>(Table<TSource>, Expression<Func<TSource, bool>>)

    Returns a CqlQuery which after execution will return the first element of the sequence that satisfies a condition or a default value if no such element is found. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuerySingleElement<TSource> FirstOrDefault<TSource>(this Table<TSource> source, Expression<Func<TSource, bool>> predicate)
    Parameters
    Type Name Description
    Table<TSource> source

    The Table<TSource> to return the first element of.

    Expression<Func<TSource, bool>> predicate

    A function to test each element for a condition.

    Returns
    Type Description
    CqlQuerySingleElement<TSource>

    a CqlQuery<TSource> which after execution will return default(TSource) if source is empty or if no element passes the test specified by predicate, otherwise the first element in source that passes the test specified by predicate.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    First<TSource>(CqlQuery<TSource>)

    Returns a CqlQuery which after execution will return the first element in a sequence. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuerySingleElement<TSource> First<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to return the first element of.

    Returns
    Type Description
    CqlQuerySingleElement<TSource>

    a CqlQuery<TSource> which after execution will return first element in the sequence.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    First<TSource>(Table<TSource>, Expression<Func<TSource, bool>>)

    Returns a CqlQuery which after execution returns the first element in a sequence that satisfies a specified condition. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuerySingleElement<TSource> First<TSource>(this Table<TSource> source, Expression<Func<TSource, bool>> predicate)
    Parameters
    Type Name Description
    Table<TSource> source

    The Table<TSource> to return the first element of.

    Expression<Func<TSource, bool>> predicate

    A function to test each element for a condition.

    Returns
    Type Description
    CqlQuerySingleElement<TSource>

    a CqlQuery<TSource> which after execution will return first element in the sequence that passes the test in the specified predicate function.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    GroupBy<TKey, TSource>(CqlQuery<TSource>, Expression<Func<TSource, TKey>>)

    Returns a CqlQuery which after execution returns grouped sequence of values based on a predicate. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuery<IGrouping<TKey, TSource>> GroupBy<TKey, TSource>(this CqlQuery<TSource> source, Expression<Func<TSource, TKey>> predicate)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to filter.

    Expression<Func<TSource, TKey>> predicate

    A function to test each element for a condition.

    Returns
    Type Description
    CqlQuery<IGrouping<TKey, TSource>>

    a CqlQuery<TSource> which after execution will return an IEnumerable<TSource> that contains elements from the input sequence that satisfy the condition.

    Type Parameters
    Name Description
    TKey

    The type of the value returned by selector.

    TSource

    The type of the elements of source.

    OrderByDescending<TSource, TKey>(CqlQuery<TSource>, Expression<Func<TSource, TKey>>)

    Sorts the elements, which are returned from CqlQuery, in ascending order according to a key.

    Declaration
    public static CqlQuery<TSource> OrderByDescending<TSource, TKey>(this CqlQuery<TSource> source, Expression<Func<TSource, TKey>> func)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    A sequence of values to order, returned from CqlQuery<TSource>.

    Expression<Func<TSource, TKey>> func

    A function to extract a key from an element.

    Returns
    Type Description
    CqlQuery<TSource>

    a CqlQuery<TSource> which after execution returns an IEnumerable<TSource> sorted in descending manner according to a key.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    TKey

    The type of the key returned by keySelector.

    OrderBy<TSource, TKey>(CqlQuery<TSource>, Expression<Func<TSource, TKey>>)

    Sorts the elements, which are returned from CqlQuery, in ascending order according to a key.

    Declaration
    public static CqlQuery<TSource> OrderBy<TSource, TKey>(this CqlQuery<TSource> source, Expression<Func<TSource, TKey>> keySelector)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    A sequence of values to order, returned from CqlQuery<TSource>.

    Expression<Func<TSource, TKey>> keySelector

    A function to extract a key from an element.

    Returns
    Type Description
    CqlQuery<TSource>

    a CqlQuery<TSource> which after execution returns an IEnumerable<TSource> sorted in ascending manner according to a key.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    TKey

    The type of the key returned by keySelector.

    Select<TSource, TResult>(CqlQuery<TSource>, Expression<Func<TSource, TResult>>)

    Projects each element of a sequence into a new form.

    Declaration
    public static CqlQuery<TResult> Select<TSource, TResult>(this CqlQuery<TSource> source, Expression<Func<TSource, TResult>> selector)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    A CqlQuery<TSource> which after execution returns a sequence of values to invoke a transform function on.

    Expression<Func<TSource, TResult>> selector

    A transform function to apply to each element.

    Returns
    Type Description
    CqlQuery<TResult>

    a CqlQuery<TSource> which after execution will return an IEnumerable<TSource> whose elements are the result of invoking the transform function on each element of source. To execute this CqlQuery use Execute() method.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    TResult

    The type of the value returned by selector.

    Select<TGroup, TSource, TResult>(CqlQuery<IGrouping<TGroup, TSource>>, Expression<Func<IGrouping<TGroup, TSource>, TResult>>)

    Declaration
    public static CqlQuery<TResult> Select<TGroup, TSource, TResult>(this CqlQuery<IGrouping<TGroup, TSource>> source, Expression<Func<IGrouping<TGroup, TSource>, TResult>> selector)
    Parameters
    Type Name Description
    CqlQuery<IGrouping<TGroup, TSource>> source
    Expression<Func<IGrouping<TGroup, TSource>, TResult>> selector
    Returns
    Type Description
    CqlQuery<TResult>
    Type Parameters
    Name Description
    TGroup
    TSource
    TResult

    Take<TSource>(CqlQuery<TSource>, int)

    Returns a CqlQuery which after execution will return IEnumerable<TSource> with specified number of contiguous elements from the start of a sequence. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuery<TSource> Take<TSource>(this CqlQuery<TSource> source, int count)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to return the first element of.

    int count

    The number of elements to return.

    Returns
    Type Description
    CqlQuery<TSource>

    a CqlQuery<TSource> which after execution will return IEnumerable<TSource> with specified number of contiguous elements from the start of a sequence.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    ThenByDescending<TSource, TKey>(CqlQuery<TSource>, Expression<Func<TSource, TKey>>)

    Sorts the elements, which are returned from CqlQuery, in descending order according to a key.

    Declaration
    public static CqlQuery<TSource> ThenByDescending<TSource, TKey>(this CqlQuery<TSource> source, Expression<Func<TSource, TKey>> func)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Expression<Func<TSource, TKey>> func
    Returns
    Type Description
    CqlQuery<TSource>
    Type Parameters
    Name Description
    TSource
    TKey

    ThenBy<TSource, TKey>(CqlQuery<TSource>, Expression<Func<TSource, TKey>>)

    Sorts the elements, which are returned from CqlQuery, in ascending order according to a key.

    Declaration
    public static CqlQuery<TSource> ThenBy<TSource, TKey>(this CqlQuery<TSource> source, Expression<Func<TSource, TKey>> func)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Expression<Func<TSource, TKey>> func
    Returns
    Type Description
    CqlQuery<TSource>
    Type Parameters
    Name Description
    TSource
    TKey

    UpdateIfExists<TSource>(CqlQuery<TSource>)

    Returns a representation of a UPDATE ... IF EXISTS cql statement, for Lightweight Transactions support.

    Declaration
    public static CqlConditionalCommand<TSource> UpdateIfExists<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Returns
    Type Description
    CqlConditionalCommand<TSource>
    Type Parameters
    Name Description
    TSource

    UpdateIf<TSource>(CqlQuery<TSource>, Expression<Func<TSource, bool>>)

    Returns a representation of a UPDATE ... IF ... cql statement, for Lightweight Transactions support

    Declaration
    public static CqlConditionalCommand<TSource> UpdateIf<TSource>(this CqlQuery<TSource> source, Expression<Func<TSource, bool>> predicate)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Expression<Func<TSource, bool>> predicate
    Returns
    Type Description
    CqlConditionalCommand<TSource>
    Type Parameters
    Name Description
    TSource

    Update<TSource>(CqlQuery<TSource>)

    Returns a representation of a UPDATE cql statement

    Declaration
    public static CqlUpdate Update<TSource>(this CqlQuery<TSource> source)
    Parameters
    Type Name Description
    CqlQuery<TSource> source
    Returns
    Type Description
    CqlUpdate
    Type Parameters
    Name Description
    TSource

    Where<TSource>(CqlQuery<TSource>, Expression<Func<TSource, bool>>)

    Returns a CqlQuery which after execution returns filtered sequence of values based on a predicate. To execute this CqlQuery use Execute() method.

    Declaration
    public static CqlQuery<TSource> Where<TSource>(this CqlQuery<TSource> source, Expression<Func<TSource, bool>> predicate)
    Parameters
    Type Name Description
    CqlQuery<TSource> source

    The CqlQuery<TSource> to filter.

    Expression<Func<TSource, bool>> predicate

    A function to test each element for a condition.

    Returns
    Type Description
    CqlQuery<TSource>

    a CqlQuery<TSource> which after execution will return an IEnumerable<TSource> that contains elements from the input sequence that satisfy the condition.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    Back to top © DataStax, All rights reserved.