Page 1 of 1

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

Posted: Fri 29 Oct 2021 18:52
by rei
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

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

Posted: Mon 01 Nov 2021 09:23
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

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

Posted: Tue 09 Nov 2021 15:52
by Shalex
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.