Table of Contents

Namespace ToSic.Sxc.Code

Namespaces

ToSic.Sxc.Code.Generate

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.

ITypedModel

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");.