Table of Contents

Interface ITemplate

Namespace
HoofMark.CSharpTemplating.Abstractions
Assembly
HoofMark.CSharpTemplating.Abstractions.dll

Marker interface for template classes. Implement this in your template file and the engine will discover and execute it.

public interface ITemplate

Examples

public class MyTemplate : ITemplate
{
    public static void Run(ITemplateContext context)
    {
        var ns = context.Config.Get("Namespace");
        context.WriteFile("Output.cs", $"namespace {ns} {{ }}");
    }
}

Methods

Run(ITemplateContext)

public static abstract void Run(ITemplateContext context)

Parameters

context ITemplateContext