我有两张桌子:
------Product-----
| ProductID (key)|
| DescricptionID |
|----------------|
---Description----------
| DescriptionType (key)|
| DescriptionID (key)|
| LanguageID (key)|
| Description |
|----------------------|
如果我想在和*.edmx
之间的文件中创建一个新的关联,我必须为表中的每个主键指定。所以我为此创建了一个新的 Partial 类。
例如:Products
Description
Dependent Properties
Description
public partial class Product
{
public int DescriptionType
{
get { return 1; }
set { this.DescriptionType = 1; }
}
public string LanguageID
{
get { return "EN"; }
set { this.LanguageID = "EN"; }
}
}
现在问题如下:如何在我的*.edmx
文件中看到这个新属性来选择Dependent Properties
这两个表之间的新关联。
我知道数据库的设计不正确,但不可能改变它。那么我的问题还有其他解决方案吗?