Table of Contents

Namespace ToSic.Sxc.Code

Namespaces

ToSic.Sxc.Code.Generate.Sys
ToSic.Sxc.Code.Sys.HotBuild

Interfaces

ICodeCustomizer

Helper object to use on Razor, Code, APIs to create more app-specific helper objects. Like the App object, View object etc.

It will usually be provided on a protected Customize property on RazorTyped etc.

ICodeLog

A special logger for dynamic code (Razor, WebApi). It is always available to add messages to insights.

IDevTools

WIP!!!

This should provide special APIs to assist developers. It will probably change from version to version, so the use should be limited to quick debugs and similar, but never remain in the code.

IDynamicCode12

Interface for Dynamic Code with enhancements after v12. It extends ToSic.Sxc.Code.Sys.IDynamicCode

Dynamic Code is the API for files like Razor or WebApis. Supports many properties like App, etc. to ensure that the dynamic code has everything you need.
Also provides many Conversions between IEntity and IDynamicEntity. Important for dynamic code files like Razor or WebApi. Note that there are many overloads to ensure that AsDynamic and AsEntity "just work" even if you give them the original data.

ITypedApi

This API describes objects with a TypedApi.

ITypedRazorModel

Object in partial Razor files to access parameters handed in. Example caller:

@Html.Partial(someFile, new { blogPost, file = mainFile, title = "hello" }

Example partial:

var blogPost = MyModel.Item("BlogPost");
var file = MyModel.File("File");
var title = MyModel.String("Title");
Tip

The common data types such as string or ITypedItem have methods to quickly get them in the desired type. This allows things such as var message = MyModel.String("Message"); For less common types you'll need to use Get(string, NoParamOrder, bool?) and cast it as needed, like this: string message = MyModel.Get("Message");.