Query Types
Query Types
Hello,
I have a couple of classes in my model that have QueryType set to true. I just set the output of my classes to EF Core 3.0 from 2.0 and now when I run my application I get a message saying that the class in question requires a primary key and if I intended it to be a keyless entity that I should have called HasNoKey(). Is this a bug in the Entity Developer generated output? I do not see anywhere else in the designer to mark the class as not requiring a key. Any help appreciated.
-Scott
I have a couple of classes in my model that have QueryType set to true. I just set the output of my classes to EF Core 3.0 from 2.0 and now when I run my application I get a message saying that the class in question requires a primary key and if I intended it to be a keyless entity that I should have called HasNoKey(). Is this a bug in the Entity Developer generated output? I do not see anywhere else in the designer to mark the class as not requiring a key. Any help appreciated.
-Scott
Re: Query Types
Please set EF Core version=EF Core 3 in Model Settings and regenerated the code.
Re: Query Types
Thanks for the reply, but what I'm saying it that's what I've already done - set the output type to 3 and it is not generating the proper code and I am receiving the error I mentioned in my post. I am using build 6.6.852.
-Scott
-Scott
Re: Query Types
With EF Core version=EF Core 3 (Model Settings) and QueryType=True (class properties), Entity Developer generates modelBuilder.Entity<...>().HasNoKey(). Runtime works in our test. Refer to https://docs.microsoft.com/en-us/ef/cor ... changes#qt.
If this doesn't help, send us a small complete test project for reproducing the issue.
If this doesn't help, send us a small complete test project for reproducing the issue.
Re: Query Types
I just used the link you provided to send you a copy of my model.
Thanks,
Scott
Thanks,
Scott
Re: Query Types
We have reproduced the issue. It persists when Self-Contained Entity Configuration is set to True in the EF Core template properties.
As a temporary workaround, please set Self-Contained Entity Configuration=False.
As a temporary workaround, please set Self-Contained Entity Configuration=False.
Re: Query Types
I'm glad you found the issue but disabling the entities configuration file does not work for me, I need to keep my model classes clean. Please advise as to when this issue will be corrected.
Thanks,
Scott
Thanks,
Scott
Re: Query Types
The bug with generating .HasNoKey(), when Self-Contained Entity Configuration is set to True in properties of EF Core template, in EF Core 3 model is fixed.
We have sent the internal build with the fix to your email.
We have sent the internal build with the fix to your email.
Re: Query Types
That did indeed fix my problem, thank you so much!
Regards,
Scott
Regards,
Scott
Re: Query Types
New build of Entity Developer 6.6.872 is available for download now: viewtopic.php?f=32&t=39567.