How to access the EF model annotations in Migration class, Up method?
I mean those annotations:
modelBuilder.Entity<Role>().HasAnnotation("constraint1", constraint);
In this method:
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// how to access annotations? means get value of Role's "constraint1" annotation
}
}
Migration's build process (on its automation step) can use annotations (as well as other definitions) but then if you want to manually append/change migration code it is not obvious how to access metadata.