diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/ITemplateRenderer.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/ITemplateRenderer.cs
index 92a1c0782c..b153a5130b 100644
--- a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/ITemplateRenderer.cs
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/ITemplateRenderer.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Globalization;
using System.Threading.Tasks;
using JetBrains.Annotations;
@@ -6,10 +7,19 @@ namespace Volo.Abp.TextTemplating
{
public interface ITemplateRenderer
{
+ ///
+ /// Renders a text template.
+ ///
+ /// The template name
+ /// An optional model object that is used in the template
+ /// Culture name. Uses the if not specified
+ /// A dictionary which can be used to import global objects to the template
+ ///
Task RenderAsync(
[NotNull] string templateName,
[CanBeNull] object model = null,
- [CanBeNull] string cultureName = null
+ [CanBeNull] string cultureName = null,
+ [CanBeNull] Dictionary globalContext = null
);
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateRenderer.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateRenderer.cs
index 4ff2beb9ba..2824c6e463 100644
--- a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateRenderer.cs
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateRenderer.cs
@@ -30,7 +30,8 @@ namespace Volo.Abp.TextTemplating
public virtual async Task RenderAsync(
[NotNull] string templateName,
[CanBeNull] object model = null,
- [CanBeNull] string cultureName = null)
+ [CanBeNull] string cultureName = null,
+ [CanBeNull] Dictionary globalContext = null)
{
Check.NotNullOrWhiteSpace(templateName, nameof(templateName));
@@ -43,7 +44,7 @@ namespace Volo.Abp.TextTemplating
{
return await RenderInternalAsync(
templateName,
- new Dictionary(),
+ globalContext ?? new Dictionary(),
model
);
}