# CustomDataSourceBuilder

## Methods

### Transport(System.Action)

Configures the transport of the DataSource

#### Parameters

##### configurator - System.Action<[CustomDataSourceTransportBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/customdatasourcetransportbuilder)>

The lambda which configures the Transport property

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Batch(true)
                .PageSize(20)
                .Schema(schema => schema.Model(m => m.Id(p => p.ProductID)))
                .Transport(transport =>
                {
                    transport.Read(read =>
                       read.Url("https://demos.telerik.com/service/v2/core/products")
                    );
                    transport.Create(create =>
                        create.Url("https://demos.telerik.com/service/v2/core/products/create")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.Update(update =>
                        update.Url("https://demos.telerik.com/service/v2/core/products/update")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.Destroy(destroy =>
                        destroy.Url("https://demos.telerik.com/service/v2/core/products/destroy")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.ParameterMap("parameterMap");
                })
            )
             
```

### Schema(System.Action)

Configures Schema properties

#### Parameters

##### configurator - System.Action<[CustomDataSourceSchemaBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/customdatasourceschemabuilder)>

The lambda which configures the Schema property

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Batch(true)
                .PageSize(20)
                .Schema(schema => schema.Model(m => m.Id(p => p.ProductID)))
                .Transport(transport =>
                {
                    transport.Read(read =>
                       read.Url("https://demos.telerik.com/service/v2/core/products")
                    );
                    transport.Create(create =>
                        create.Url("https://demos.telerik.com/service/v2/core/products/create")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.Update(update =>
                        update.Url("https://demos.telerik.com/service/v2/core/products/update")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.Destroy(destroy =>
                        destroy.Url("https://demos.telerik.com/service/v2/core/products/destroy")
                            .Type(HttpVerbs.Post)
                            .ContentType("application/json")
                    );
                    transport.ParameterMap("parameterMap");
                })
            )
             
```

### Sort(System.Action)

Configures the initial sorting.

#### Parameters

##### configurator - System.Action<[DataSourceSortDescriptorFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcesortdescriptorfactory)>

The lambda which configures the Sort Action

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Sort(s => s.Add("ShipName"))
            )
             
```

### Group(System.Action)

Configures the initial grouping.

#### Parameters

##### configurator - System.Action<[DataSourceGroupDescriptorFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcegroupdescriptorfactory)>

The lambda which configures the Group Action

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Group(s => s.Add(a =>a.ShipName))
            )
             
```

### Aggregates(System.Action)

Configures the initial aggregates.

#### Parameters

##### aggregates - System.Action<[DataSourceAggregateDescriptorFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourceaggregatedescriptorfactory)>

The Aggregates set for the Custom DataSource

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                        .Aggregates(aggregates =>
                        {
                            aggregates.Add(p => p.UnitsInStock).Min().Max().Count();
                            aggregates.Add(p => p.UnitsOnOrder).Average();
                            aggregates.Add(p => p.ProductName).Count();
                            aggregates.Add(p => p.UnitPrice).Sum();
                        })
            )
             
```

### Filter(System.Action)

Configures the initial filter.

#### Parameters

##### configurator - System.Action<[DataSourceFilterDescriptorFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourcefilterdescriptorfactory)>

The lambda which configures the Filter Action

#### RETURNS

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

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Filter(f => f.Add(a => a.ShipName))
            )
             
```

### Events(System.Action)

Configures the client-side events

#### Parameters

##### configurator - System.Action<[DataSourceEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/datasourceeventbuilder)>

The lambda which configures the Update Action

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Events(e => e.Push("onDataSourcePush"))
            )
             
```

### Total(System.Int32)

Sets the total number of records in the data source. Required during Custom binding.

#### Parameters

##### total - `System.Int32`

Number of records

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Total(50)
            )
             
```

### PageSize(System.Int32)

Sets the number of records displayed on a single page.

#### Parameters

##### pageSize - `System.Int32`

An integer value for the size of a Page in the Custom DataSource

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .PageSize(20)
            )
             
```

### AccentFoldingFiltering(System.String)

Configures whether diacritic filtering should be used.

#### Parameters

##### culture - `System.String`

The culture applied for the Action

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .AccentFoldingFiltering("bg-BG")
            )
             
```

### Page(System.Int32)

Sets the page of the DataSource.

#### Parameters

##### page - `System.Int32`

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Page(3)
            )
             
```

### ServerPaging(System.Boolean)

Enables or disables server paging mode. If enabled the data source will make a request during paging.

#### Parameters

##### enabled - `System.Boolean`

True to enable server paging; otherwise false (the default).

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .ServerPaging(false)
            )
             
```

### ServerSorting(System.Boolean)

Enables or disables server sorting mode. If enabled the data source will make a request during paging.

#### Parameters

##### enabled - `System.Boolean`

True to enable server sorting; otherwise false (the default).

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .ServerSorting(false)
            )
             
```

### ServerFiltering(System.Boolean)

Enables or disables server filtering mode. If enabled the data source will make a request during filtering.

#### Parameters

##### enabled - `System.Boolean`

True to enable server filtering; otherwise false (the default).

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .ServerFiltering(false)
            )
             
```

### ServerGrouping(System.Boolean)

Enables or disables server grouping mode. If enabled the data source will make a request during grouping.

#### Parameters

##### enabled - `System.Boolean`

True to enable server grouping; otherwise false (the default).

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .ServerGrouping(false)
            )
             
```

### ServerAggregates(System.Boolean)

Enables or disables server aggregates. If enabled the data source will expect the aggregates to be calculated server-side.

#### Parameters

##### enabled - `System.Boolean`

True to enable server aggregates; otherwise false (the default).

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .ServerAggregates(false)
            )
             
```

### Batch(System.Boolean)

Determines if modifications will be sent to the server in batches or as individually requests.

#### Parameters

##### enabled - `System.Boolean`

If true changes will be batched, otherwise false.

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Batch(true)
            )
             
```

### AutoSync(System.Boolean)

Determines if data source would automatically sync any changes to its data items. By default changes are not automatically sync-ed.

#### Parameters

##### enabled - `System.Boolean`

If true changes will be automatically synced, otherwise false.

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .AutoSync(true)
            )
             
```

### Transport(System.Object)

Sets the transport of the DataSource using anonymous object.

#### Parameters

##### settings - `System.Object`

### Type(System.String)

Sets the type of the data source.

#### Parameters

##### type - `System.String`

#### RETURNS

The  instance for method chaining.

#### Example

```
 
            .DataSource(dataSource => dataSource
                .Custom()
                .Type("odata")
            )
             
```
