【发布时间】:2012-04-21 11:26:16
【问题描述】:
我有以下实体:
public class User
{
public int ID {get; set;}
public int GroupID {get; set;} // navigation property with
public Group Group {get; set;} // foreign key field
public Adress Adress {get; set;} // navigation property only
}
实体框架生成的表格如下:
ID
GroupID
Adress_ID
我不喜欢 FK 列的列命名不一样。我可以实现两者都使用相同的约定“GroupID,AdressID”或“Group_ID,Adress_ID”吗?
我使用约定优于配置,不想使用 Fluent API。
【问题讨论】:
标签: .net entity-framework ef-code-first entity-framework-migrations