Namespace ToSic.Eav.DataSources
DataSources are objects which deliver one or many DataStreams, which contain a bunch of content-items. They are then attached to each other (from one sources Out
to another ones In
) creating a Query
. Queries can be customized at will. The whole system is used to prepare/process data for views, WebApi or anything else.
In most cases there will be a VisualQuery which connects all the parts automatically, but when you want to work with them programatically, here you'll find the API.
Note
We've hidden the constructors for all DataSource objects in these docs, because you should usually use the CreateSource<T>(...)
command on the Razor template or WebApi, which will auto-configure things behind the scenes.
Tip
Read about DataSources here. It also explains how the configuration system works and how to create custom DataSources to deliver your data to EAV/2sxc.
Classes
App
All the data inside an App.
For example, it has a variable amount of Out-streams, one for each content-type in the app.
AppRoot
The App Root is the entry point for all data. It takes it's data from a hidden AppState Cache.
It's implemented as a DataSource so that other DataSources can easily attach to it.
This is also the object returned as the root in any query.
AttributeFilter
DataSource to only pass through configured AttributeNames - other attributes/properties are removed from the entities.
AttributeRename
DataSource to rename attributes. Will help to change internal field names to something which is more appropriate for your JS or whatever.
Children
Get Children Entities (child-relationships) of the Entities coming into this DataSource
Csv
DataSource for importing/reading CSV files.
DataTable
Provide Entities from a System.Data.DataTable.
This is not meant for VisualQuery, but for code which pre-processes data in a DataTable and then wants to provide it as entities.
EntityIdFilter
A DataSource that filters Entities by Ids. Can handle multiple IDs if comma-separated.
EntityTypeFilter
Keep only entities of a specific content-type
Error
Internal DataSource to generate an error on purpose. This is to test / verify error handling in VisualQuery. See also VisualQuery 3: Debugging
ItemFilterDuplicates
A DataSource that removes duplicate items in a Stream. Often used after a StreamMerge.
LanguageModeler
Remodels multi-language values in own fields (like NameDe, NameEn) to single multi-language fields like Name
Metadata
Get Metadata (metadata Entities) of the Entities coming into this DataSource
MetadataTargets
Get Target Entities (metadata targets) of the Entities coming into this DataSource
OwnerFilter
Filter entities to show only these belonging to a specific user.
Paging
Do Paging to only return a limited amount of results + show how many such pages exist and which Page we are on.
Parents
Get Parent Entities (parent-relationships) of the Entities coming into this DataSource
PassThrough
A DataSource that forwards all In
Connections. It's more for internal use.
PublishingFilter
Filter entities to show Drafts or only Published Entities
QueryRun
Run another query and provide the resulting data. The settings will provide the params for the inner query.
RelationshipFilter
Filter Entities by Value in a Related Entity. For example: Find all Books (desired Entity), whose Authors (related Entity) have a Country (Attribute) with 'Switzerland' (Value).
Serialization
DataSource which changes how Streams will be serialized in the end.
Shuffle
Shuffle / Randomize the order of items in a Stream.
Sql
Provide Entities from a SQL Server
StreamFallback
A DataSource that returns the first stream which has content
StreamMerge
A DataSource that merges all streams on the In
into one Out
stream
StreamPick
A DataSource that returns a stream by the provided name. Usually this will be configured through [Params:SomeName]
TreeModeler
Use this to take imported data from elsewhere which is a table but would have a tree-like structure (folders, etc.). Tell it where/how the relationships are mapped, and it will create Entities that have navigable relationships for this.
ValueFilter
Return only Entities having a specific value in an Attribute/Property
ValueSort
Sort Entity by values in specified Attributes / Properties
Interfaces
IAppRoot
Interface for the App Root - usually the very first node in any data-delivery or query.
It's just like a normal IDataSource but will internally access the AppState from the Cache/>.