/// <summary> /// Runs the template using the specified <paramref name="model"/>. /// </summary> /// <param name="templateRunner"></param> /// <param name="model"></param> /// <param name="viewBag"></param> /// <returns></returns> public static string Run <TModel>(this ITemplateRunner <TModel> templateRunner, TModel model, DynamicViewBag viewBag = null) { using (var textWriter = new StringWriter()) { templateRunner.Run(model, textWriter, viewBag); return(textWriter.ToString()); } }
protected TemplateMap2 (string attributeId, ITemplateRunner templateRunner, object template, string inputExtension, string outputFormat) { AttributeIdentifier = attributeId; TemplateRunner = templateRunner; InputExtension = RemovePeriod(inputExtension); OutputFormat = outputFormat; Template = template; }
public TemplateMap(string attributeIdentifier, ITemplateRunner templateRunner, object template, string metadataDirectory, string inputExtension, string outputFormat, string outputDirectory) { AttributeIdentifier = attributeIdentifier; TemplateRunner = templateRunner; Template = template; MetadataDirectory = metadataDirectory; InputExtension = RemovePeriod(inputExtension); OutputFormat = outputFormat; OutputDirectory = outputDirectory; }