Data Sources

Data sources provide the endpoints with data (end then endpoints represent that data in some way and return as the responses). Data sources use the specified implementation of the IDataProvider interface to get, prepare, or generate data (it can be anything: the database records, weather forecast, some hardcoded text). It can be useful because a developer can prepare different data providers that can be then used and combined by a user to provide all the required data for, for example, the specific website pages. You can manage them (create, edit, and delete) from the backend using the Data sources section of the endpoints:

../_images/121.png

Each data source has code and data provider C# class name:

../_images/213.png

Code

Code is used as the model property name. So, if you have specified some code, your model (for example, a view model) will have a property with this name.

Data provider C# class

It allows you to specify, which C# class (implementation of the IDataProvider interface) will provide data for this data source.

There are few built-in data providers. PageObjectDataProvider loads the object by its URL property value. ObjectsDataProvider loads the objects of the specified class. RelatedObjectsDataProvider loads the objects that are related to the one, which URL property value matches current request’s URL.