Interface IRazorTemplateService
Defines methods for rendering templates.
Namespace: DataWeb.Templating
Assembly: DataWeb.Core.dll
Syntax
public interface IRazorTemplateService
Methods
RenderAsync(string, object, CancellationToken)
Renders the specified template with the given model.
Declaration
Task<string> RenderAsync(string name, object model, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the template to render. |
object | model | The model to use for rendering the template. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | A string representing the rendered template. |
RenderAsync(string, CancellationToken)
Renders the specified template.
Declaration
Task<string> RenderAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the template to render. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | A string representing the rendered template. |