Interface ITypedApiService
This is a service to give you Typed Code outside 2sxc.
[PublicApi]
public interface ITypedApiService
Remarks
Use this to access 2sxc data from a Theme, a .ascx WebControl or anywhere else.
History
- New in v20
Methods
ApiOfApp(int)
Get an API object for a specific App.
ITypedApi ApiOfApp(int appId)
Parameters
appIdint
Returns
ApiOfApp(int, int)
Get an API object for a specific App.
ITypedApi ApiOfApp(int zoneId, int appId)
Parameters
Returns
ApiOfModule(int, int)
Get an API object for a specific Module - the Module must have a 2sxc App or Content on it for this to work.
ITypedApi ApiOfModule(int pageId, int moduleId)
Parameters
Returns
Remarks
This is to work with the content, data or app on this specific module. It is not meant for module-level metadata, which should be on the ApiOfSite.
ApiOfSite()
Get an API object for a current Site/Portal.
ITypedApi ApiOfSite()
Returns
ApiOfSite(int)
Get an API object for a specified Site/Portal.
ITypedApi ApiOfSite(int siteId)
Parameters
siteIdint
Returns
ApiOfSite(int, int, int)
Get an API object for a specific Site/Portal including proper context of a specific Module on a page.
ITypedApi ApiOfSite(int siteId, int pageId, int moduleId)
Parameters
Returns
Remarks
This is the most complex way to get an API, but it will give you the most complete context for your code, which you need for ModuleMetadata.
App(NoParamOrder, int?, int?, ISite?, bool?)
Get the Typed App object for a specific App, which is the most convenient way to work with the content of this App.
IAppTyped App(NoParamOrder npo = default, int? zoneId = null, int? appId = null, ISite? site = null, bool? withUnpublished = null)
Parameters
npoNoParamOrderzoneIdint?appIdint?siteISitewithUnpublishedbool?
Returns
AppOfSite()
Get the Typed App object for the site-wide App, which contains shared data.
IAppTyped AppOfSite()