TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

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

Support for c# nullable projects #115

Closed JohnGoldInc closed 4 years ago

JohnGoldInc commented 4 years ago

Closes #101

JohnGoldInc commented 4 years ago

@tonysneed Really having a hard time with squash and getting it to work right (sorry)

tonysneed commented 4 years ago

Don't worry about squash just yet. I can show you how to do that after I've reviewed and approved your PR.

More importantly, you should try to follow each step in the Contributing Guidelines, especially Step 15. But don't worry about that right now either. Just hang tight while I review the PR.

JohnGoldInc commented 4 years ago

@tonysneed Ok, All Fixed up now; think I came to better naming which explains why I am doing some things. (like why I needed to change HbsEntityTypeTransformationService.cs )

tonysneed commented 4 years ago

I hate to say it, but you should keep nullable-reference-types instead of property-initializes-default. The reason is that this info is not specific to a property, but rather it is based on _options?.Value?.EnableNullableReferenceTypes. Can you please change it back?

Also put EntityPropertyInfo back the way it was before. PropertyIsNullable was correct.

JohnGoldInc commented 4 years ago

@tonysneed Fixed, had to do handlebars syntax as:

{{#if nullable-reference-types }}{{#unless property-isnullable}} = default!;{{/unless}}{{/if}}

Because no logical "and" or "not" in handlebars plain

JohnGoldInc commented 4 years ago

@tonysneed I checked in my changes to the expected context strings this time with a replacing slashes with double slashes logic.

tonysneed commented 4 years ago

@JohnGoldInc OK I think we are ready for the merge. If you allow me to make changes to your branch, I will be glad to rebase and squash your commits.

In the lower right-hand corner of this PR you should see a checkbox labeled Allow edits and access to secrets by maintainers. Please check it. Then I will be able to squash and merge your PR. Thanks!

JohnGoldInc commented 4 years ago

I just check it but I think since you have merged, it doesn't matter anymore and doesn't stay set :)

Thanks for helping me through, git with forked projects is so much more than what I am used too.

tonysneed commented 4 years ago

@JohnGoldInc Thanks very much for your contribution! I will mention you in the next release.

To learn more about the Git workflow I use, you can watch this online tutorial I created.

Here are the instructions I followed to squash your commits: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html