Muonroi.Templating.Abstractions
2.0.2
dotnet add package Muonroi.Templating.Abstractions --version 2.0.2
NuGet\Install-Package Muonroi.Templating.Abstractions -Version 2.0.2
<PackageReference Include="Muonroi.Templating.Abstractions" Version="2.0.2" />
<PackageVersion Include="Muonroi.Templating.Abstractions" Version="2.0.2" />
<PackageReference Include="Muonroi.Templating.Abstractions" />
paket add Muonroi.Templating.Abstractions --version 2.0.2
#r "nuget: Muonroi.Templating.Abstractions, 2.0.2"
#:package Muonroi.Templating.Abstractions@2.0.2
#addin nuget:?package=Muonroi.Templating.Abstractions&version=2.0.2
#tool nuget:?package=Muonroi.Templating.Abstractions&version=2.0.2
Muonroi.Templating.Abstractions
Abstract definitions and contracts for template rendering engines within the Muonroi ecosystem.
Overview
Muonroi.Templating.Abstractions provides the core interfaces required for template rendering within the Muonroi Building Blocks architecture. It abstracts away the underlying templating engine implementation (like Scriban, Liquid, or Razor), allowing developers to rely on standard contracts throughout their codebase without tightly coupling to any specific rendering technology.
This package is designed for library authors building components that require dynamic content generation, such as email dispatchers, document generators, and notification systems, enabling seamless substitution of the templating engine at the application composition root.
By relying on this abstraction, the wider Muonroi ecosystem guarantees that rendering is handled predictably and interchangeably. It promotes the SOLID principles, specifically the Dependency Inversion Principle, where high-level modules (your business logic) do not depend on low-level modules (the rendering engine), but both depend on abstractions.
Ecosystem Combinations
Works great standalone. Becomes significantly more powerful when combined.
+ Templating.Scriban → Scriban implements ITemplateEngine; swap without changing calling code
Muonroi.Templating.Scriban provides the robust implementation. Simply swap your DI registration to change engines without touching your application logic.
+ Pdf → Templating renders HTML templates; Pdf renders the HTML to PDF
By combining with Muonroi.Pdf, you can use ITemplateEngine to construct a dynamic HTML string, then pipe it into the PDF layout engine to generate rich reports.
+ Tenancy → Per-tenant template resolution: different tenants get different templates
Using Muonroi.Tenancy, you can dynamically select which template string to render based on ITenantContext.CurrentTenantId.
+ Caching → Template compilation results cached: GetOrSetAsync("tpl:{name}", () ⇒ engine.CompileAsync(...))
Integrate Muonroi.Caching.Abstractions to cache the compiled AST of your templates for blazing fast execution.
Full Stack
builder.Services.AddSingleton<ITemplateEngine, ScribanTemplateEngine>();
builder.Services.AddMPdfService();
builder.Services.AddTenantContext();
Installation
dotnet add package Muonroi.Templating.Abstractions
Samples
- samples/PdfGeneration/ - HTML to PDF generation using templates.
- samples/MultiTenantSaaS/ - Per-tenant template resolution.
License
Apache 2.0 — see LICENSE-APACHE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Muonroi.Templating.Abstractions:
| Package | Downloads |
|---|---|
|
Muonroi.RuleEngine.Runtime
Runtime orchestration layer for Muonroi RuleEngine, providing execution pipelines and integration points for rule evaluation services. |
|
|
Muonroi.RuleEngine.Proliferation
Rule Proliferation Engine — AI-driven neuron scenario generation and execution for Muonroi RuleEngine. |
|
|
Muonroi.Templating.Scriban
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.2 | 386 | 8/26/2026 |