If I have the following model:
[Table("Person")]
public class PersonDao
{
public Guid Id { get; set; }
public ICollection<Address> { get; set; }
// other properties
}
[Table("Address")]
public class AddressDao
{
public Guid Id { get; set; }
public PersonDao Person { get; set; }
// other properties
}
Entity Framework uses Person
and Address
correctly for the table names but the foreign key in Address
is called PersonDao_Id
. I want it to be Person_Id
.
Is this a bug or am I supposed to write a custom convention for the property names?
NOTE: I use MySQL with Entity Framework, I don't know if that matters.
EDIT: I know that I can specify the column name manually using the ForeignKey
attribute or the fluent API. I need this to work automatically and globally.