Soenneker.Extensions.Strings.Templating 11.0.337

Prefix Reserved
dotnet add package Soenneker.Extensions.Strings.Templating --version 11.0.337
                    
NuGet\Install-Package Soenneker.Extensions.Strings.Templating -Version 11.0.337
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Extensions.Strings.Templating" Version="11.0.337" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Strings.Templating" Version="11.0.337" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Strings.Templating" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Extensions.Strings.Templating --version 11.0.337
                    
#r "nuget: Soenneker.Extensions.Strings.Templating, 11.0.337"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Extensions.Strings.Templating@11.0.337
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Extensions.Strings.Templating&version=11.0.337
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Strings.Templating&version=11.0.337
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.Strings.Templating

Render Scriban templates from a string with dictionary-backed global values and a short-lived parse cache.

Installation

dotnet add package Soenneker.Extensions.Strings.Templating

Render values

using Soenneker.Extensions.Strings.Templating;

var values = new Dictionary<string, object?>
{
    ["customer_name"] = "Ada",
    ["items"] = new[] { "Keyboard", "Mouse" }
};

string template = "Hello {{ customer_name }}. {{ items | array.size }} items are ready.";
string result = await template.Render(values);

Dictionary keys become top-level Scriban variables. Values may be scalar values, collections, or objects that Scriban can expose through its normal member-access rules. Null or empty dictionaries are supported.

The optional partials dictionary also adds string-valued globals:

var snippets = new Dictionary<string, string>
{
    ["signature"] = "Thanks,\nSupport"
};

string result = await "{{ message }}\n\n{{ signature }}".Render(
    new Dictionary<string, object?> { ["message"] = "Your export is ready." },
    snippets);

These values are not registered with a Scriban ITemplateLoader; they are strings, not independently parsed include files. Keep keys unique across both dictionaries because globals are read-only once added.

Parsing and caching

Parsed templates are cached by exact template text for 30 seconds. Invalid syntax throws InvalidOperationException with Scriban's parse messages. Rendering errors propagate from Scriban. The method returns a ValueTask<string> because Scriban rendering can be asynchronous.

Security

Treat the template as executable input. Scriban expressions can traverse the objects supplied in replacements; do not render templates from untrusted users against privileged application objects. Supply narrow DTOs or scalar values, and encode or sanitize the rendered result for its destination. Rendering does not automatically provide HTML, SQL, shell, or URL escaping.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.337 75 12/3/2026
11.0.336 55 12/3/2026
11.0.335 55 12/2/2026
11.0.334 52 12/2/2026
11.0.333 52 12/2/2026
11.0.332 53 12/2/2026
11.0.331 50 12/2/2026
11.0.330 60 12/2/2026
11.0.329 60 12/2/2026
11.0.328 55 12/2/2026
11.0.327 56 12/2/2026
11.0.326 69 12/1/2026
11.0.325 63 12/1/2026
11.0.324 62 12/1/2026
11.0.323 57 12/1/2026
11.0.322 106 11/30/2026
11.0.320 100 11/29/2026
11.0.319 218 11/18/2026
11.0.318 105 11/18/2026
11.0.317 96 11/18/2026
Loading failed

Update dependency Soenneker.Extensions.String to 11.0.837 (#717)