Show / Hide Table of Contents

Class SortOrderBuilder<T>

Utility class to construct a valid sort order parameter for a query to the Contentful API.

Inheritance
System.Object
SortOrderBuilder<T>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace:Contentful.Core.Search
Assembly:cs.temp.dll.dll
Syntax
public class SortOrderBuilder<T>
Type Parameters
Name Description
T

Constructors

SortOrderBuilder(String, SortOrder)

Initializes a new instance of SortOrderBuilder<T>

Declaration
protected SortOrderBuilder(string field, SortOrder order = SortOrder.Normal)
Parameters
Type Name Description
System.String field

The field to sort by.

SortOrder order

The order of the sorting. Default is Normal.

Methods

Build()

Builds this sortorderbuilder and returns the produced querystring.

Declaration
public string Build()
Returns
Type Description
System.String

The built querystring.

New(String, SortOrder)

Creates a new instance of SortOrderBuilder<T>

Declaration
public static SortOrderBuilder<T> New(string field, SortOrder order = SortOrder.Normal)
Parameters
Type Name Description
System.String field

The field to sort by.

SortOrder order

The order of the sorting. Default is Normal.

Returns
Type Description
SortOrderBuilder<T>

A new SortOrderBuilder<T> instance.

New<U>(Expression<Func<T, U>>, SortOrder)

Creates a new instance of SortOrderBuilder<T>

Declaration
public static SortOrderBuilder<T> New<U>(Expression<Func<T, U>> selector, SortOrder order = SortOrder.Normal)
Parameters
Type Name Description
Expression<System.Func<T, U>> selector

The expression of the field to sort by.

SortOrder order

The order of the sorting. Default is Normal.

Returns
Type Description
SortOrderBuilder<T>

A new SortOrderBuilder<T> instance.

Type Parameters
Name Description
U

ThenBy(String, SortOrder)

Adds another field to sort by to the current SortOrderBuilder<T>.

Declaration
public SortOrderBuilder<T> ThenBy(string field, SortOrder order = SortOrder.Normal)
Parameters
Type Name Description
System.String field

The field to sort by.

SortOrder order

The order of the sorting. Default is Normal.

Returns
Type Description
SortOrderBuilder<T>

The SortOrderBuilder<T> instance.

ThenBy<U>(Expression<Func<T, U>>, SortOrder)

Adds another field to sort by to the current SortOrderBuilder<T>.

Declaration
public SortOrderBuilder<T> ThenBy<U>(Expression<Func<T, U>> selector, SortOrder order = SortOrder.Normal)
Parameters
Type Name Description
Expression<System.Func<T, U>> selector

The expression of the field to sort by.

SortOrder order

The order of the sorting. Default is Normal.

Returns
Type Description
SortOrderBuilder<T>

The SortOrderBuilder<T> instance.

Type Parameters
Name Description
U
Back to top Copyright © 2015-2016 Contentful
Generated by DocFX