TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

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

[Feature request] Allow new partial templates to be registered #73

Closed omatrot closed 4 years ago

omatrot commented 5 years ago

I naïvely added a new template in the partials folder of my project and tried to called it from the Class template. I receive the following error at runtime:

Referenced partial name _partialname could not be resolved

tonysneed commented 5 years ago

CSharpTemplateLanguageService and TypeScriptTemplateLanguageService classes would need to be updated to pick up all files in DbContextPartialsDirectory and EntityTypePartialsDirectory.

Care to submit a pull request? 😄

omatrot commented 5 years ago

I'll do that tomorrow morning my time.

tonysneed commented 4 years ago

@omatrot Is this resolved?

omatrot commented 4 years ago

No coul'nt find the time to look at it.

TryAndErr0r commented 4 years ago

I made a fork wich provide this feature. I am new to github so here is the link i guess?https://github.com/TryAndErr0r/EntityFrameworkCore.Scaffolding.Handlebars/tree/aa2b4a90e0bce7cdedfe1b8c4ed0119ed6ec01bb

It is just a few changes. The idea is that all files in the "Partials" folder can be addressed in the DbContext.hbs and Class.hbs file. If the file name is "Propertiesitem.hbs" it can be called with {{{> propertiesitem}}}

gejotas commented 4 years ago

I made a fork wich provide this feature. I am new to github so here is the link i guess?https://github.com/TryAndErr0r/EntityFrameworkCore.Scaffolding.Handlebars/tree/aa2b4a90e0bce7cdedfe1b8c4ed0119ed6ec01bb

It is just a few changes. The idea is that all files in the "Partials" folder can be addressed in the DbContext.hbs and Class.hbs file. If the file name is "Propertiesitem.hbs" it can be called with {{{> propertiesitem}}}

I've created a PR containing your code and some improvements.

tonysneed commented 4 years ago

@gejotas I looked for your PR and didn't see it. Can you link to it?

gejotas commented 4 years ago

@tonysneed #106