2
我有以下实体:EF代码第4.3命名约定外键
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。
'http://stackoverflow.com/questions/18050590/why-does-ef5-create-foreign-keys-with -id-but-recommend-naming-convention-id-wi/18066373?noredirect = 1#18066373'解释了列出现的原因 – 2013-08-05 20:09:16