Table of Contents

Interface IAppReaderFactory

Namespace
ToSic.Eav.Apps
Assembly
ToSic.Eav.Apps.dll

Internal system to retrieve AppReaders for accessing app state/data directly.

It is documented but not meant to be used outside the core team.

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public interface IAppReaderFactory

Remarks

This was introduced in 2sxc 18 to replace older AppStates mechanisms. It ensures that the reading actions are done in a controlled way, and that the app state is always up-to-date.

Methods

AppIdentity(int)

IAppIdentityPure AppIdentity(int appId)

Parameters

appId int

Returns

IAppIdentityPure

Get(int)

Get a reader for the specified app.

IAppReader Get(int appId)

Parameters

appId int

Returns

IAppReader

The expected app - or throws an exception.

Get(IAppIdentity)

Get a reader for the specified app.

IAppReader Get(IAppIdentity appIdentity)

Parameters

appIdentity IAppIdentity

Returns

IAppReader

GetOrKeep(IAppIdentity)

Helper for internal purposes. Sometimes code will get an app identity, but it could also be a Reader. For performance reasons, this will get you the reader, but possibly without having to create a new one.

IAppReader GetOrKeep(IAppIdentity appIdOrReader)

Parameters

appIdOrReader IAppIdentity

Returns

IAppReader

GetSystemPreset()

IAppReader GetSystemPreset()

Returns

IAppReader

GetZonePrimary(int)

Get a reader of the zone's primary app. Typically, this is he site-primary app, which contains site metadata and settings.

IAppReader GetZonePrimary(int zoneId)

Parameters

zoneId int

Returns

IAppReader

ToReader(IAppStateCache)

IAppReader? ToReader(IAppStateCache state)

Parameters

state IAppStateCache

Returns

IAppReader

TryGet(IAppIdentity)

Get a reader for the specified app.

IAppReader? TryGet(IAppIdentity appIdentity)

Parameters

appIdentity IAppIdentity

Returns

IAppReader

TryGetSystemPreset(bool)

Get the preset App of the system. In a very special case, it should skip this if it's not loaded.

IAppReader? TryGetSystemPreset(bool nullIfNotLoaded)

Parameters

nullIfNotLoaded bool

Returns

IAppReader