# DataSourceSortDescriptorFactory

## Methods

### Add(System.Linq.Expressions.Expression)

Add field based on which the data will be sorted.

#### Parameters

##### expression - `System.Linq.Expressions.Expression<Func>`

#### RETURNS

A [DataSourceSortDescriptorBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcesortdescriptorbuilder) instance for method chaining.

#### Example

```
 
               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add(add => add.OrderId)
                   )
            )
             
```

### Add(System.String)

Add field based on which the data will be sorted.

#### Parameters

##### fieldName - `System.String`

#### RETURNS

A [DataSourceSortDescriptorBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcesortdescriptorbuilder) instance for method chaining.

#### Example

```
 
               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add("OrderId")
                   )
            )
             
```

### Add(System.String)

Add field based on which the data will be sorted.

#### Parameters

##### memberName - `System.String`

The name of the member to sort by.

#### RETURNS

A [DataSourceSortDescriptorBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcesortdescriptorbuilder) instance for method chaining.

#### Example

```
 
               @(Html.Kendo().DataSource<OrderViewModel>()
                  .Name("dataSource")
                   .Ajax(dataSource => dataSource
                      .Read(read => read.Action("Orders_Read", "DataSource"))
                      .Sort(s=>s.Add("OrderId")
                   )
            )
             
```
