EF version 6 and above...
How do I use built-in OR custom EF conventions like KeyAttributeConvention
, IndexAttributeConvention
, etc. to change foreign key constraint names and index names?
I'm looking to change these names from one place rather than ask developers to follow naming standards for their database migrations.
For example, I don't want to use the ForeignKey
method's name
parameter in the migration code to specify a foreign key constraint name.
Instead, there should be a common convention configured using the model builder which performs the task when a foreign key is being generated.
Is it really possible?