mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-19 06:59:43 +02:00
Refactor Transformer (add Scriban) (#562)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using HandlebarsDotNet;
|
||||
using WireMock.Handlers;
|
||||
|
||||
namespace WireMock.Transformers.Handlebars
|
||||
{
|
||||
internal class HandlebarsContext : IHandlebarsContext
|
||||
{
|
||||
public IHandlebars Handlebars { get; set; }
|
||||
|
||||
public IFileSystemHandler FileSystemHandler { get; set; }
|
||||
|
||||
public string ParseAndRender(string text, object model)
|
||||
{
|
||||
var template = Handlebars.Compile(text);
|
||||
|
||||
return template(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user