This package provides a small abstraction to generate text from templates, independently of the underlying templating engine.
It defines the TextTemplate<TModel> base class and the ITextTemplateRenderContext interface, which can be implemented by concrete template engines.
Currently only the following text engine implementation are provided in PosInformatique.Foundations:
- PosInformatique.Foundations.Text.Templating.Razor
- PosInformatique.Foundations.Text.Templating.Scriban
You can install the package from NuGet:
dotnet add package PosInformatique.Foundations.Text.Templating- Abstraction to represent a text template with a strongly-typed model:
TextTemplate<TModel> - Asynchronous rendering API through
RenderAsync - Pluggable rendering context via
ITextTemplateRenderContextto access services during template execution - Engine-agnostic design: can be used with different template engines (Razor, etc.)
This package only provides the abstraction (base classes and interfaces). To actually render templates using Razor components, use one of the dedicated implementation package: