TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

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

Private functions used in overridable methods? #204

Open slymuffhugger opened 2 years ago

slymuffhugger commented 2 years ago

Not sure if this qualifies as a "bug", but when attempting to override GenerateProperties by copy/pasting the existing code and modifying I'm met with the dreaded red squiggles because the original Method uses private properties and methods.. I can copy/paste those too, but if it ever changes I won't get those changes. Would it be better if they were public or internal? image

tonysneed commented 2 years ago

Good questions. The private methods can probably be made protected.

Might make a good PR if you are interested. 😄

slymuffhugger commented 2 years ago

Haven't really contributed much before but I could give it a go 😃

tonysneed commented 2 years ago

Might make for a good first PR. See the contributing guidelines to how to get started.

slymuffhugger commented 2 years ago

Would we want all of _options accessible or would it be better just to make a protected property that accesses the one property within _options? And should it return false when _options is null? something like protected bool GenerateComments => _options?.Value?.GenerateComments ?? false;

tonysneed commented 2 years ago

Not a bad idea to make the options protected.