Interface IDataSourcesService
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
typeTypethe .net type of this data-source
attachIDataSourceLinkableoptional source to attach as
inon the newly created data source. It can also provideAppIdentityandLookUpoptionsIDataSourceOptionsoptional 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
typeTypethe .net type of this data-source
optionsIDataSourceOptionsoptional 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
optionsIDataSourceOptionsrequired 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
attachIDataSourceLinkableoptional source to attach as
inon the newly created data source. It can also provideAppIdentityandLookUpoptionsIDataSourceOptionsoptional configuration lookup if needed
Returns
- TDataSource
Type Parameters
TDataSourceThe 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
optionsIDataSourceOptionsoptional configuration lookup if needed
Returns
- TDataSource
Type Parameters
TDataSourceThe type of the data source to be created.
Remarks
Released in v21.02