Scripting API Reference

This document provides an exhaustive technical reference of the properties, methods, and injected services available within the Struktural C# Scripting Sandbox (IScriptContextBridge).

It is optimized to serve as a strict technical guide for developers and AI assistants.

1. Core Context Properties

These properties expose the current state of the application and the data being manipulated.

2. Data Fetching & EF Core Operations

Because scripts run asynchronously within a high-performance engine, synchronous database calls (e.g., .ToList(), .FirstOrDefault()) are strictly forbidden as they cause thread-pool starvation.

Mandatory EF Core Async Methods

You must import Microsoft.EntityFrameworkCore and use its asynchronous extensions for all queries:

Optimized Navigation Loaders

To prevent the overhead of deep Include() chains or N+1 query problems, Struktural provides optimized lazy-loading methods:

Out-of-Band Persistence

3. The UI Controller (Ui)

The Ui property exposes the IUiContext interface, allowing backend scripts to push reactive updates to the frontend browser.

4. Execution Interruption

5. System Services

These services are natively injected into the script context.

6. Utilities