TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

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

AddHandlebarsHelpers ignores all but last one Added #162

Closed jryutzy closed 3 years ago

jryutzy commented 3 years ago

When I have multiple Handlebar Helpers it only recognizes the second one image

image

It throws an error that it can't find the first helper (attributeHelper) image

If I remove the second helper (myHelper) then attributeHelper works but of course myHelper can't be used.

Please advise

jryutzy commented 3 years ago

@tonysneed I was able to use this approach until the bug is resolved to fix services.AddHandlebarHelpers() https://github.com/Handlebars-Net/Handlebars.Net#registering-helpers image

tonysneed commented 3 years ago

@jryutzy Glad you found a workaround. This looks like a good catch. I'll try to replicate as soon as I get a chance.

tonysneed commented 3 years ago

@jryutzy services.AddHandlebarsHelpers takes a params argument of helpers so that you can pass multiple helpers at the same time. So instead of calling it multiple times, just call it once and pass both of your helpers.

services.AddHandlebarsHelpers(attributeHelper, myHelper);