-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Milestone
Description
I have migrated from RC2 and now I am having this warning when I generate migrations:
The key {'Id'} on entity type 'ExtraDeliveryCostByVolume' contains properties in shadow state - {'Id'}. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'CoreEventId.ModelValidationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
I understand that Id
property is shadow, it is true, but, why is it a warning? is there any problem on having a shadow property as primary key?
The model is configured in the follow way:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
. . .
modelBuilder.Entity<ExtraDeliveryCostByVolume>(entity =>
{
entity.Property<int>("Id").UseSqlServerIdentityColumn();
entity.Property(x => x.ExtraDeliveryCost).HasColumnType("decimal(12,8)");
entity.HasKey("Id");
. . .
Further technical details
EF Core version: 1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
IDE: Visual Studio 2015