【发布时间】:2014-07-25 14:49:33
【问题描述】:
有没有办法改变实体框架的命名约定?
例子:
我有两张桌子
Planification
--------------
creator_id <fk>
guest_id <fk>
Profile
--------------
profile_id <pk>
creator_id 和 guest_id 都是 profile_id 的外键
默认情况下,实体会生成这样的平面类
public string guest_id { get; set; }
public string creator_id { get; set; }
public virtual Profile Profile { get; set; }
public virtual Profile Profile1 { get; set; }
我更喜欢比Profile 和Profile1 更具体的东西,比如Guest 和Creator。
有没有办法改变命名约定,因为这样让我感到非常内疚。
【问题讨论】:
标签: c# entity-framework ef-database-first