I am using Code first and my ID column looks like this:
[Key]
[Required]
public int ID { get; set; }
Am trying to cancel the identity of some tables and cannot do it. I am using Fluent API:
.Property(b => b.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
and the generated code is of migration is:
public override void Up()
{
AlterColumn("MyEntity", "ID", c => c.Int(nullable: false,
identity: false));
}
public override void Down()
{
AlterColumn("MyEntity", "ID", c => c.Int(nullable: false,
identity: true));
}
But it doesn't change in the db. Any ideas please?