Skip to content

The entity type 'EntityName' is part of a hierarchy, but does not have the discriminator value configured. #6433

@dpjain

Description

@dpjain

Created an entity with discriminator values in OnModelCreating method in ApplicationDbContext class:

 builder.Entity<EntityName>()
                .HasDiscriminator<int>("Type")
                .HasValue<DerivedClass1>(1)
                .HasValue<DerivedClass2>(2)
                .HasValue<DerivedClass3>(3);

Issue

After migrating the asp.net core RC1 project to asp.net core 1.0 project, tried to update the db using command line (dotnet ef database update), but facing the following issue:
The entity type 'EntityName' is part of a hierarchy, but does not have the discriminator value configured.

EF Core version: "Microsoft.EntityFrameworkCore": "1.0.0"
Visual Studio version: VS 2015

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions