Skip to main content

HtmlEditorVariablesBuilder.DataSource(Func<DataSourceFactory, OptionsOwnerBuilder>) Method

Binds variables to data, allows you to configure data access from different sources: API controllers, Razor page handlers, OData services, arrays, and more.

Namespace: DevExtreme.AspNet.Mvc.Builders

Assembly: DevExtreme.AspNet.Core.dll


public HtmlEditorVariablesBuilder DataSource(
    Func<DataSourceFactory, OptionsOwnerBuilder> configurator


Name Type Description
configurator Func<DataSourceFactory, OptionsOwnerBuilder>

A function that allows you to configure access to data.


Type Description

A reference to this instance after the method is called.


To specify a data source, use a lambda expression. The lambda parameter is a DataSourceFactory class instance that provides methods to configure data access from different sources.

The following example demonstrates how to bind variables to an API controller:

    .Variables(variables => variables
        .DataSource(ds => ds.Mvc()
See Also