Sequence contains more than one matching element when adding a migration

ef-migrations entity-framework-6 tph

Question

The following code in my DbContext class causes an error when I try to add a migration

protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Entity<TaskExt>()
            .Map<TaskDespatch>(m => { m.Requires("WorkStationID").HasValue(160).HasColumnType("int"); });
        base.OnModelCreating(modelBuilder);

    }

What am I missing?

1
1
11/25/2016 6:42:03 AM

Popular Answer

The field name was "WorkstationID" in the database. Correcting the "S" to be lower case stopped the message.

1
11/25/2016 6:56:16 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow