Class ProjectionBuilder<T>
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
fieldstringThe 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
fieldExpressionExpression<Func<T, TField>>The field to exclude from the projection.
Returns
- ExclusiveProjectionBuilder<T>
The projection builder.
Type Parameters
TFieldThe 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
fieldstringThe 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
fieldExpressionExpression<Func<T, TField>>The field to include in the projection.
Returns
- InclusiveProjectionBuilder<T>
The projection builder.
Type Parameters
TFieldThe 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
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
fieldExpressionExpression<Func<T, TField>>The field to include in the projection.
startintlengthint
Returns
- ProjectionBuilder<T>
The projection builder.
Type Parameters
TFieldThe type of the field to include.