我在我的应用程序中使用了Entity Framework v6.1.1。
我的数据库有两个表格 User, Location。
User table
-----------
UserID
HomeCityId(FK -> LocationId)
CurrentCityId(FK -> LocationId)
Location table
LocationId
LocationName
使用数据库优先方法,我为这两个表创建了一个实体数据模型。
生成的用户表实体类:
public int UserId;
public int HomeCityId;
public int CurrentCityId;
public virtual Location Location { get; set; }
public virtual Location Location1 { get; set; }
有没有办法将这些虚拟属性命名为 HomeCity 和 CurrentCity,而不是 Location 和 Location1?