我有国家/地区表“tblCountry”,其中有 2 列国家/地区名称、国家/地区 ID,我想显示国家/地区名称,但将国家/地区 ID 存储在其余表中。请告诉我从创建模型到查看的方法,我使用的是数据库优先方法。
public partial class tblRFATCountry
{
public long CountryID { get; set; }
public string Country { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
这是我尝试添加字典的模型。
public partial class tblRFATCountry
{
public long CountryID { get; set; }
public string Country { get; set; }
public dictionary<string, long> countryDic = new dictionary<string, long>();
}
Run Code Online (Sandbox Code Playgroud)
我想做类似的事情,以便我可以显示名称但存储值。请建议