Table of Contents

Class CustomDataSourceAdvanced

Namespace
ToSic.Eav.DataSource
Assembly
ToSic.Eav.DataSources.dll

The base class for all DataSources, especially custom DataSources. It must always be inherited. It provides a lot of core functionality to get configurations, ensure caching and more.

Important: in most cases you will inherit the CustomDataSource DataSource for custom data sources.

[PublicApi]
public abstract class CustomDataSourceAdvanced : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
Inheritance
CustomDataSourceAdvanced
Implements
Derived
Inherited Members

Remarks

Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.

Constructors

CustomDataSourceAdvanced(MyServices, string, object[])

Initializes an DataSource which will usually provide/generate external data.

protected CustomDataSourceAdvanced(CustomDataSourceAdvanced.MyServices services, string logName = null, object[] connect = null)

Parameters

services CustomDataSourceAdvanced.MyServices

Dependencies needed by this data source and/or the parent

logName string

The log name/identifier for insights logging. Optional, but makes debugging a bit easier when provided.

connect object[]

Remarks

set the cache creation date to the moment the object is constructed this is important, because the date should stay fixed throughout the lifetime of this object but renew when it is updates

CustomDataSourceAdvanced(MyServicesBase<MyServices>, string)

protected CustomDataSourceAdvanced(MyServicesBase<CustomDataSourceAdvanced.MyServices> services, string logName = null)

Parameters

services MyServicesBase<CustomDataSourceAdvanced.MyServices>
logName string

Properties

CacheTimestamp

System time-stamp of when the data in this cached thing was initialized or updated. Depending on the implementation, this may go up-stream and return an up-stream value.

public override long CacheTimestamp { get; }

Property Value

long

A timestamp as a long number

DataFactory

[PublicApi]
protected IDataFactory DataFactory { get; }

Property Value

IDataFactory