Table of Contents

Interface IDataSourcesService

Namespace
ToSic.Eav.Services
Assembly
ToSic.Eav.DataSource.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.

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public interface IDataSourcesService

Remarks

  • Released in v15.06
  • Slimmed down in v21.02, but keeping older APIs available and hidden, in case they are used (but this is unlikely).

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.

[Obsolete("making this obsolete in v21; believe it's almost never used outside of 2sxc/eav")]
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 Made obsolete in v21, as it is almost never used outside of 2sxc/eav - and we want to be able to remove it from the public API at some point.

Create(Type, 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, IDataSourceOptions? options = null)

Parameters

type Type

the .net type of this data-source

options IDataSourceOptions

optional configuration lookup if needed

Returns

IDataSource

A single DataSource

Remarks

Released in v21.02

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.

[Obsolete("making this obsolete in v21; believe it's almost never used outside of 2sxc/eav")]
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.

Create<TDataSource>(IDataSourceOptions?)

Preferred way to create DataSources.

TDataSource Create<TDataSource>(IDataSourceOptions? options = null) where TDataSource : IDataSource

Parameters

options IDataSourceOptions

optional configuration lookup if needed

Returns

TDataSource

Type Parameters

TDataSource

The type of the data source to be created.

Remarks

Released in v21.02