TemplateCollectionBase
Namespace: Proffer.Templating
Abstract base class to load and apply templates from a named Proffer.Storage.IStore.
public abstract class TemplateCollectionBase
Inheritance Object → TemplateCollectionBase
Properties
Loader
Gets the templates loader.
public ITemplateLoader Loader { get; }
Property Value
Constructors
TemplateCollectionBase(String, IStorageFactory, ITemplateLoaderFactory)
Initializes a new instance of the TemplateCollectionBase class.
public TemplateCollectionBase(string storeName, IStorageFactory storageFactory, ITemplateLoaderFactory templateLoaderFactory)
Parameters
storeName
String
The name of the store.
storageFactory
IStorageFactory
The storage factory.
templateLoaderFactory
ITemplateLoaderFactory
The template loader factory.
Methods
LoadAndApplyTemplate(String, Object)
Loads the template and applies context.
protected Task<string> LoadAndApplyTemplate(string templatePath, object context)
Parameters
templatePath
String
The template path.
context
Object
The context.
Returns
Task<String>
The templated result.
LoadAndApplyTemplate(String, Object, IFormatProvider)
Loads the template and applies context.
protected Task<string> LoadAndApplyTemplate(string templatePath, object context, IFormatProvider formatProvider)
Parameters
templatePath
String
The template path.
context
Object
The context.
formatProvider
IFormatProvider
The format provider.
Returns
The templated result.