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

HasKey Reference Left Out with Non-Conventional Key Property #203

Closed
davidhendrickmb opened this issue Jan 19, 2022 · 8 comments · Fixed by #205
Closed

HasKey Reference Left Out with Non-Conventional Key Property #203

davidhendrickmb opened this issue Jan 19, 2022 · 8 comments · Fixed by #205
Labels
bug Something isn't working

Comments

@davidhendrickmb
Copy link

Hi there,

This is in relation to the issue here which Erik has mentioned is a problem with this package.
The HasKey reference is being left out when I use Handlebars templates with EF Core 6. Would you know of a fix for this?ErikEJ/EFCorePowerTools#1250

Thanks,
David

@davidhendrickmb davidhendrickmb added the bug Something isn't working label Jan 19, 2022
@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 19, 2022

Or maybe the Key attribute?

@tonysneed
Copy link
Contributor

Thanks for reporting the bug. I'll work on fixing it.

@davidhendrickmb
Copy link
Author

Thank you :)
If you happen to find a temporary workaround please let me know as I'm trying to test out Net 6 upgrade.

@tonysneed
Copy link
Contributor

@davidhendrickmb I am looking at this now. It has to do with the PK not following EF Core naming conventions. I will fix the bug, but if you wish to have a workaround, simply make sure your PK entity property follows the standard EF Core naming convention for key fields. In other words, entitynameId. In your case this would be: AccompanimentTypeId

@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 22, 2022

Potential duplicate: ErikEJ/EFCorePowerTools#1256

@RaulFunezp
Copy link

I have exactly the same problem when using HandleBars in ErikEJ/EfCorePowerTools. The name of my HasKey not generated is like this: AeDeCtaCB.

I hope that when Tony solves that bug, it will solve my case too.
Thank you

@tonysneed tonysneed changed the title HasKey reference is being left out when using Handlebars in EFCorePowerTools targeting EF Core 6 HasKey Reference Left Out with Non-Conventional Key Property Jan 22, 2022
@tonysneed
Copy link
Contributor

@ErikEJ @davidhendrickmb @RaulFunezp Fixed with Handlebars v6.0.3.

@davidhendrickmb
Copy link
Author

Thanks Tony, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants