Table of Contents

Class ServiceKitLight16

Namespace
ToSic.Sxc.Services
Assembly
ToSic.Sxc.dll

Lightweight ServiceKit for 2sxc v15. It's primarily used in dynamic code which runs standalone, without a module context.

Example: Custom DataSources can run anywhere without actually being inside a module or content-block. In such scenarios, certain services like the IPageService would not be able to perform any real work.

[PublicApi]
public class ServiceKitLight16 : ServiceBase, IHasLog
Inheritance
object
ServiceBase
ServiceKitLight16
Implements

Remarks

  • History: Added v15.06 - still WIP

Constructors

ServiceKitLight16(IServiceProvider)

Lightweight ServiceKit for 2sxc v15. It's primarily used in dynamic code which runs standalone, without a module context.

Example: Custom DataSources can run anywhere without actually being inside a module or content-block. In such scenarios, certain services like the IPageService would not be able to perform any real work.

public ServiceKitLight16(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Remarks

  • History: Added v15.06 - still WIP

Properties

Convert

The Convert Service, used to convert any kind of data type to another data type

public IConvertService Convert { get; }

Property Value

IConvertService

Data

The Data service to get DataSources and similar.

public IDataService Data { get; }

Property Value

IDataService

Remarks

  • added in v15.06

Feature

The Features service, used to check if features are enabled

public IFeaturesService Feature { get; }

Property Value

IFeaturesService

HtmlTags

The Razor Blade 4 HtmlTags service, to fluidly create Tags. See .

Important

This is similar but different to the Razor.Blade.Tag. The Razor Blade IHtmlTag objects returned here are immutable. This means that chained commands like ...HtmlTags.Div().Id(...).Class(...) all return new objects and don't modify the previous one.

The older Tag helper created mutable objects where chaining always modified the original and returned it again.

public IHtmlTagsService HtmlTags { get; }

Property Value

IHtmlTagsService

Remarks

Added in v15

Json

The JSON service, used to convert data to-and-from JSON

public IJsonService Json { get; }

Property Value

IJsonService

Scrub

The Razor-Blade Scrub service, used to clean up HTML. See Razor Blade IScrub Service

public IScrub Scrub { get; }

Property Value

IScrub

SecureData

The Secure Data service - mainly for reading / decrypting secrets.

public ISecureDataService SecureData { get; }

Property Value

ISecureDataService

SystemLog

The System Log service, used to add log messages to the system (Dnn/Oqtane)

public ISystemLogService SystemLog { get; }

Property Value

ISystemLogService