Kirsten
Kirsten

Reputation: 18150

Sequence contains more than one matching element when adding a migration

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?

Upvotes: 1

Views: 583

Answers (1)

Kirsten
Kirsten

Reputation: 18150

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

Upvotes: 1

Related Questions