HandlebarsTemplate

Namespace: Proffer.Templating.Handlebars

A template reference can be executed on a specific context using N:HandlebarsDotNet.

public class HandlebarsTemplate : Proffer.Templating.ITemplate

Inheritance ObjectHandlebarsTemplate
Implements ITemplate

Constructors

HandlebarsTemplate(String)

Initializes a new instance of the HandlebarsTemplate class.

public HandlebarsTemplate(string templateContent)

Parameters

templateContent String
Content of the template.

HandlebarsTemplate(IHandlebars, String)

Initializes a new instance of the HandlebarsTemplate class.

public HandlebarsTemplate(IHandlebars handlebars, string templateContent)

Parameters

handlebars IHandlebars
The Handlebars service.

templateContent String
Content of the template.

Methods

Apply(Object)

Applies the specified context on the template.

public string Apply(object context)

Parameters

context Object
The context.

Returns

String

        The templated result.

Apply(Object, IFormatProvider)

Applies the specified context on the template with format provider.

public string Apply(object context, IFormatProvider formatProvider)

Parameters

context Object
The context.

formatProvider IFormatProvider
The format provider.

Returns

String

        The templated result.