我有一個EDM實體「擴展」 - 在這個對象內是屬性擴展。我已經把所有其他列連接好了,但是這個連接拒絕連接。我猜,因爲實體和財產共享相同的名稱? 這裏是我的代碼,擴展不起作用,前綴不工作:實體框架:實體名稱與屬性相同時的元數據?
Imports System.Web.DynamicData
Imports System.ComponentModel.DataAnnotations
<MetadataType(GetType(ExtensionsMetaData))> _
Partial Public Class Extensions
End Class
Public Class ExtensionsMetaData
Private _phones_extensions As Object
Private _prefix As Object
Private _did_flag As Object
Private _len As Object
Private _sfc_id As Object
Private _name_display As Object
Private _floor As Object
Private _room As Object
Private _phones_departments As Object
Private _phones_buildings As Object
Private _phones_phones As Object
Private _phones_restriction_classes As Object
Private _phones_tens As Object
<DisplayName("Extension")> _
Public Property extensions() As Object
Get
Return _phones_extensions
End Get
Set(ByVal value As Object)
_phones_extensions = value
End Set
End Property
<DisplayName("Prefix")> _
Public Property prefix As Object
Get
Return _prefix
End Get
Set(ByVal value As Object)
_prefix = value
End Set
End Property
末級
我如何獲得此代碼工作?我已經查看了所有通過我的數據模型,它看起來像名稱應該是擴展!
我收到的錯誤是:類型'phoneDBentities.Extensions'的關聯元數據類型包含以下未知屬性或字段:擴展名。請確保這些成員的名稱與主類型的屬性名稱相匹配。
對於任何面臨同樣問題的人,以下是我如何修復它: 1.打開我的EDM。 2.選擇實體。 3.右鍵單擊並選擇重命名。 4.將實體添加到名稱的末尾。 很簡單。 – davemackey 2010-06-30 18:00:44