abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.93k stars 3.44k forks source link

[Text templating Scriban] How can I pass a raw string instead of template name? #14271

Closed chucamphong closed 2 years ago

chucamphong commented 2 years ago

How can I pass a raw string instead of template name? If yes, how should I do it?

Example:

public class Controller {
  private readonly ITemplateRenderer _templateRenderer;

  // ...

  _templateRenderer.RenderAsync("Hello {{ name }}", new { Name = "World" });
}

Thanks

maliming commented 2 years ago

You can use Scriban API instead of ITemplateRenderer.