Skip to content

Method CreateSafeCodeFromTemplate

Namespace: Belay.Core.Security
Assembly: Belay.Core.dll

CreateSafeCodeFromTemplate(string, IReadOnlyDictionary<string, object?>)

Creates a safe Python code template with validated parameter substitution.

csharp
public static string CreateSafeCodeFromTemplate(string template, IReadOnlyDictionary<string, object?> parameters)

Parameters

template string

The Python code template with {parameter} placeholders.

parameters IReadOnlyDictionary<string, object?>

Dictionary of parameter names and values to substitute.

Returns

string

The safely constructed Python code.

Exceptions

ArgumentException

Thrown when template or parameters are invalid.

Released under the Apache License 2.0.