Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Handlebars for 2.1 preview1 #12

Closed
ErikEJ opened this issue May 19, 2018 · 22 comments · Fixed by #28
Closed

Update Handlebars for 2.1 preview1 #12

ErikEJ opened this issue May 19, 2018 · 22 comments · Fixed by #28
Labels

Comments

@ErikEJ
Copy link
Owner

ErikEJ commented May 19, 2018

From @ErikEJ on March 27, 2018 8:35

Describe what is not working as expected.

Steps to reproduce

Include a complete description that I can redo to reproduce the issue.

Further technical details

Toolbox/Power Tools version: (found in About dialog - blue questionmark icon)

Database engine: (SQlite, SQL Compact or SQL Server)

Visual Studio or SSMS version: (e.g. Visual Studio 2017 15.3, SSMS 17.3)

Copied from original issue: ErikEJ/SqlCeToolbox#666

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

From @OmiCron07 on May 7, 2018 21:40

When will the templates come back?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

Only @tonysneed knows ??

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

From @tonysneed on May 8, 2018 10:48

I finally have some bandwidth to tackle this. Stay tuned.

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

From @tonysneed on May 12, 2018 21:38

Now that EF 2.1 is RC, I plan to update my extensions. I should have time to get started this week, but I'll definitely get it done within the next two weeks.

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

@tonysneed Ping?

@ErikEJ ErikEJ changed the title EFPT: Update Handlebars for 2.1 preview1 Update Handlebars for 2.1 preview1 May 24, 2018
@tonysneed
Copy link
Contributor

I am deep into this. What's blocking me right now is a failing test with IReverseEngineerScaffolder.ScaffoldModel, where the columns from my models aren't getting mapped. This used to work before, but it seems to be a breaking change of some sort with EF Core 2.1.

I'm thinking that I need to register a IDesignTimeDbContextFactory implementation in my test. Trying that now.

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

Thanks a lot for the update!

@tonysneed
Copy link
Contributor

Well that didn't work ... Could use someone to help me sort this out. I've narrowed it down to RelationalScaffoldingModelFactory.GetTypeScaffoldingInfo, where this line is returning null:

TypeScaffoldingInfo mapping = this._scaffoldingTypeMapper.FindMapping(column.GetUnderlyingStoreType() ?? column.StoreType, column.IsKeyOrIndex(), column.IsRowVersion());

@tonysneed
Copy link
Contributor

This is without any of my Handlebars templates in the mix. It's basically just trying to reverse engineer a database from within a unit test. The EF Core code base does not have an example of doing that, so I'm pretty much on my own.

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

@tonysneed Could you share a branch with actual code, then maybe @bricelam could help? 🙏

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

@tonysneed
Copy link
Contributor

@ErikEJ Thanks, having a look.

@bricelam
Copy link
Contributor

Here's the heart of our functional tests which generate code from a model, compile it, and load it back: https://github.com/aspnet/EntityFrameworkCore/blob/dev/test/EFCore.Design.Tests/Scaffolding/Internal/ModelCodeGeneratorTestBase.cs

@tonysneed
Copy link
Contributor

Perfect, thanks guys. ConfigureDesignTimeServices was what I was missing. I'm unblocked now.

@tonysneed
Copy link
Contributor

This issue is resolved with release 1.0.0-rc1.
The NuGet package has also been published: https://www.nuget.org/packages/EntityFrameworkCore.Scaffolding.Handlebars/1.0.0-rc

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

Great, I will try to integrate - I had to make some changes the last time, so using the source (also need strong named assemblies)

@tonysneed
Copy link
Contributor

I might be able to help with that .. perhaps fork the Handlebars.Net repo and strongly name it. Then I can strongly name mine too. Make your life easier. :)

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

Sounds great - Maybe wait until after I find out if I need to make any changes (I did the last time)

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 25, 2018

@tonysneed
Copy link
Contributor

Addressed here and here.

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 26, 2018

Thanks a lot, Tony, will give it a try and let you know

@ErikEJ ErikEJ closed this as completed May 26, 2018
@ErikEJ ErikEJ reopened this May 26, 2018
@tonysneed
Copy link
Contributor

@ErikEJ I went ahead and published the signed package: https://www.nuget.org/packages/EntityFrameworkCore.Scaffolding.Handlebars/1.0.0-rc2. So just install it normally.

ErikEJ added a commit that referenced this issue May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants