Discriminator value is always parsed as string, even when the type is set e.g. to int32

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
rei
Posts: 10
Joined: Wed 21 Jul 2021 20:07

Discriminator value is always parsed as string, even when the type is set e.g. to int32

Post by rei » Fri 29 Oct 2021 18:52

This codegen can't be right, can it?

Code: Select all

modelBuilder.Entity<CCServer.Data.Principals.Principal>()
  .HasDiscriminator(@"Kind", typeof(int))
  .HasValue<CCServer.Data.Principals.Company>(@"2")
  .HasValue<CCServer.Data.Principals.Person>(@"1");
Image

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

Re: Discriminator value is always parsed as string, even when the type is set e.g. to int32

Post by Shalex » Mon 01 Nov 2021 09:23

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

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

Re: Discriminator value is always parsed as string, even when the type is set e.g. to int32

Post by Shalex » Tue 09 Nov 2021 15:52

The bug with parsing discriminator value as string, even when its type is different, in TPH inheritance of EF Core Model is fixed in Entity Developer v6.12.1367: viewtopic.php?f=32&t=50086.

Post Reply