Table of Contents

Class ProjectionBuilder<T>

Namespace
DataStax.AstraDB.DataApi.Core.Query
Assembly
DataStax.AstraDB.DataApi.dll

A utility for specifying projections to apply to the results of an operation.

public class ProjectionBuilder<T> : IProjectionBuilder

Type Parameters

T
Inheritance
ProjectionBuilder<T>
Implements
Inherited Members

Methods

Exclude(string)

Create an exclusive projection by specifying a field to exclude.

public ExclusiveProjectionBuilder<T> Exclude(string field)

Parameters

field string

The field to exclude from the projection.

Returns

ExclusiveProjectionBuilder<T>

The projection builder.

Remarks

We recommend using the Exclude<TField>(Expression<Func<T, TField>>) method instead.

Exclude<TField>(Expression<Func<T, TField>>)

Create an exclusive projection by specifying a field to exclude.

public ExclusiveProjectionBuilder<T> Exclude<TField>(Expression<Func<T, TField>> fieldExpression)

Parameters

fieldExpression Expression<Func<T, TField>>

The field to exclude from the projection.

Returns

ExclusiveProjectionBuilder<T>

The projection builder.

Type Parameters

TField

The type of the field to exclude.

Include(string)

Create an inclusive projection by specifying a field to include.

public InclusiveProjectionBuilder<T> Include(string field)

Parameters

field string

The field to include in the projection.

Returns

InclusiveProjectionBuilder<T>

The projection builder.

Remarks

We recommend using the Include<TField>(Expression<Func<T, TField>>) method instead.

Include<TField>(Expression<Func<T, TField>>)

Create an inclusive projection by specifying a field to include.

public InclusiveProjectionBuilder<T> Include<TField>(Expression<Func<T, TField>> fieldExpression)

Parameters

fieldExpression Expression<Func<T, TField>>

The field to include in the projection.

Returns

InclusiveProjectionBuilder<T>

The projection builder.

Type Parameters

TField

The type of the field to include.

Slice(string, int, int)

Specify a field to include in the projection.

public ProjectionBuilder<T> Slice(string fieldName, int start, int length = 0)

Parameters

fieldName string

The name of the field to include.

start int
length int

Returns

ProjectionBuilder<T>

The projection builder.

Slice<TField>(Expression<Func<T, TField>>, int, int)

Specify a field to include in the projection.

public ProjectionBuilder<T> Slice<TField>(Expression<Func<T, TField>> fieldExpression, int start, int length = 0)

Parameters

fieldExpression Expression<Func<T, TField>>

The field to include in the projection.

start int
length int

Returns

ProjectionBuilder<T>

The projection builder.

Type Parameters

TField

The type of the field to include.