Table of Contents

Interface IDataSourcesService

Namespace
ToSic.Eav.Services
Assembly
ToSic.Eav.DataSources.dll

A factory to create / initialize data sources.

Not meant for use in Razor code, but to be used in custom DataSources which may need other internal data sources to work.

[PublicApi]
public interface IDataSourcesService

Remarks

Released in v15.06

Methods

Create(Type, IDataSourceLinkable, IDataSourceOptions)

Get DataSource for specified sourceName/Type.

Note that this is not the preferred way to do things - if possible, use the generic Create below.

IDataSource Create(Type type, IDataSourceLinkable attach = null, IDataSourceOptions options = null)

Parameters

type Type

the .net type of this data-source

attach IDataSourceLinkable

optional source to attach as in on the newly created data source. It can also provide AppIdentity and LookUp

options IDataSourceOptions

optional configuration lookup if needed

Returns

IDataSource

A single DataSource

Remarks

Released in v15.04

CreateDefault(IDataSourceOptions)

Gets a Default DataSource for a specific app. This is a PublishingFilter data source which returns the data the current user is allowed to see.

IDataSource CreateDefault(IDataSourceOptions options)

Parameters

options IDataSourceOptions

required configuration - must at least have an AppIdentity

Returns

IDataSource

A PublishingFilter DataSource providing data for this app.

Create<TDataSource>(IDataSourceLinkable, IDataSourceOptions)

Preferred way to create DataSources.

TDataSource Create<TDataSource>(IDataSourceLinkable attach = null, IDataSourceOptions options = null) where TDataSource : IDataSource

Parameters

attach IDataSourceLinkable

optional source to attach as in on the newly created data source. It can also provide AppIdentity and LookUp

options IDataSourceOptions

optional configuration lookup if needed

Returns

TDataSource

Type Parameters

TDataSource

The type of the data source to be created.