Skip to content

TPH: Support more discriminator conditions (NotNull etc.) #4722

Closed as duplicate
Closed as duplicate

Description

@jnm2

EF6 had the ability to use multiple discriminator properties to avoid the use of a dedicated discriminator column. You can set that it up so that if a subclass property is not null, that tells EF that the correct type is the subclass that owns the property.

It would be great to be able to go .HasDiscriminatorNotNull<TSubclass>(_ => _.SubclassProperty).

That's just a suggestion as far as what the API looks like, but we do need some way to be able to get rid of logically redundant discriminator columns to keep our tables clean.

Activity

  1. changed the title [-]TPH ability to discriminate based off which property is non-null[/-] [+]TPH: Support more disciminator conditions (NotNull etc.)[/+] on Mar 8, 2016
  2. rowanmiller commented on Mar 8, 2016

    @rowanmiller
    Contributor

    Not currently supported but we do want to enable this (and other patterns) post v1.0.0

  3. added this to the Backlog milestone on Mar 8, 2016
  4. changed the title [-]TPH: Support more disciminator conditions (NotNull etc.)[/-] [+]TPH: Support more discriminator conditions (NotNull etc.)[/+] on Mar 8, 2016
  5. AndriySvyryd commented on Oct 11, 2018

    @AndriySvyryd
    Member

    Related: #10140

  6. ajcvickers commented on Apr 15, 2019

    @ajcvickers
    Contributor

    Closing in favor of #10140 which is basically a duplicate and has gathered more details.

  7. removed this from the Backlog milestone on Apr 15, 2019
  8. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions