Table of Contents

Compare Various C# / Razor APIs

2sxc has changed a lot over time. So you'll find old code snippets and new ones, and it helps to see which one is being used. Sometimes you'll also want to convert old code to new code, and this page should help you with that.

Important

This is comparing / picking the right API. It's not meant to document all the features, but to help compare and migrate from an old API to a new one.

This page should give show you old/new APIs to make refactoring easier.

Tip

🎓 Best check out the tutorial QuickRef which shows all this!

Base Classes / @inherits Determine API

For Razor, the @inherits statement is the most important part of a Razor file, as it defines which APIs are available.

👉🏽 See Razor @inherits

If your custom C# file inherits from a base class, it will get more APIs - exactly which ones depends on the base class.

👉🏽 See C# Base Classes

If your Custom WebApi Controller inherits from a base class, it will get more APIs - exactly which ones depends on the base class.

👉🏽 See WebApi Base Classes

Built-In Objects and Services

Depending on the API generation you have selected with the base class, the built-in objects and services will be different.

👉🏽 Built-In Data Objects

👉🏽 Data Object API Differences

👉🏽 Built-In Helpers and Services

👉🏽 App & App Data

👉🏽 Settings & Resources

Sub Razor Components and Custom C# Helpers

👉🏽 Razor Sub Components

👉🏽 Custom C# Helpers / Services

Special Dnn Helpers (☢️ Dnn only)

👉🏽 Dnn helper Object