Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class ScaffoldingDesignTimeServices : IDesignTimeServices
{
public void ConfigureDesignTimeServices(IServiceCollection services)
{
// Generate both context and entitites
var options = ReverseEngineerOptions.DbContextAndEntities;
// Register Handlebars helper
var myHelper = (helperName: "my-helper", helperFunction: (Action<TextWriter, object, object[]>) MyHbsHelper);
// Add Handlebars scaffolding templates
services.AddHandlebarsScaffolding(options, myHelper);
}
// Sample Handlebars helper
void MyHbsHelper(TextWriter writer, object context, object[] parameters)
{
writer.Write("// My Handlebars Helper");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.