Using Entity Framework Code First's Seed method, I have been making calls like this to add new objects to a table.
private void SeedDatabaseActivities(SiteDbContext context)
{
context.Activities.AddOrUpdate(new ActivityDefinition
{
Id = 605,
Name = "bicycling, >20 mph, racing, not drafting",
UseSteps = false,
UseDistance = false,
Category = "bicycling",
Mets = 16
});
}
This was working great for months. Recently, this no longer sets the ID, correctly. I have been searching for why this would change, but haven't been able to find the issue.
What would cause this behavior?