Query Types

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
SSSikora
Posts: 4
Joined: Tue 23 Jul 2019 12:25

Query Types

Post by SSSikora » Sat 26 Oct 2019 20:21

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Query Types

Post by Shalex » Mon 28 Oct 2019 15:19

Please set EF Core version=EF Core 3 in Model Settings and regenerated the code.

SSSikora
Posts: 4
Joined: Tue 23 Jul 2019 12:25

Re: Query Types

Post by SSSikora » Tue 29 Oct 2019 15:45

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Query Types

Post by Shalex » Wed 30 Oct 2019 20:53

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.

SSSikora
Posts: 4
Joined: Tue 23 Jul 2019 12:25

Re: Query Types

Post by SSSikora » Wed 30 Oct 2019 21:20

I just used the link you provided to send you a copy of my model.

Thanks,
Scott

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Query Types

Post by Shalex » Wed 06 Nov 2019 12:08

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.

SSSikora
Posts: 4
Joined: Tue 23 Jul 2019 12:25

Re: Query Types

Post by SSSikora » Wed 06 Nov 2019 13:10

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Query Types

Post by Shalex » Sat 09 Nov 2019 18:58

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.

SSSikora
Posts: 4
Joined: Tue 23 Jul 2019 12:25

Re: Query Types

Post by SSSikora » Mon 11 Nov 2019 21:50

That did indeed fix my problem, thank you so much!

Regards,
Scott

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Query Types

Post by Shalex » Thu 21 Nov 2019 18:57

New build of Entity Developer 6.6.872 is available for download now: viewtopic.php?f=32&t=39567.

Post Reply