TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

Scaffold EF Core models using Handlebars templates.
MIT License
208 stars 53 forks source link

Add partial template support #106

Closed gejotas closed 4 years ago

gejotas commented 4 years ago

This contains the code by Adrian, Mehmke with some improvement to reduce code duplication and scanning of only *.hbs.

This should resolve #73

tonysneed commented 4 years ago

When I run the generator I get an error:

HandlebarsDotNet.HandlebarsRuntimeException: Referenced partial name dbimports could not be resolved   at HandlebarsDotNet.Compiler.PartialBinder.InvokePartialWithFallback(String partialName, BindingContext context, HandlebarsConfiguration configuration)
   at lambda_method(Closure , TextWriter , Object )
   at HandlebarsDotNet.Handlebars.HandlebarsEnvironment.<>c__DisplayClass7_0.<Compile>b__0(Object context)
   at EntityFrameworkCore.Scaffolding.Handlebars.HbsDbContextTemplateService.GenerateDbContext(Object data) in C:\Users\Tony\Source\EntityFrameworkCore.Scaffolding.Handlebars\src\EntityFrameworkCore.Scaffolding.Handlebars\HbsDbContextTemplateService.cs:line 44
   at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.WriteCode(IModel model, String contextName, String connectionString, String contextNamespace, String modelNamespace, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning) in C:\Users\Tony\Source\EntityFrameworkCore.Scaffolding.Handlebars\src\EntityFrameworkCore.Scaffolding.Handlebars\HbsCSharpDbContextGenerator.cs:line 127
tonysneed commented 4 years ago

@gejotas Are you able to make the changes I requested?

gejotas commented 4 years ago

@gejotas Are you able to make the changes I requested?

@tonysneed I'll look at it either this weekend or next week.

tonysneed commented 4 years ago

@gejotas Since you created this PR, I have written contributing guidelines with step-by-step instructions for creating a PR. Before you make additional commits on your feature branch, I suggest you install Visual Studio Code and configure Git to use it as its default editor. Then follow Step 15 to sync your fork with upstream commits.

Only after I have reviewed and approved your PR, follow Step 16 to squash your commits.

tonysneed commented 4 years ago

@gejotas Any ETA?

tonysneed commented 4 years ago

Resolved issues and fixed bug in new PR #124.