DateTimePropertyConfiguration.HasColumnAnnotation(String, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
針對用來儲存屬性的資料庫資料行,在模型中設定批註。 稍後可以在處理資料行時使用批註值,例如在建立移轉時。
public System.Data.Entity.ModelConfiguration.Configuration.DateTimePropertyConfiguration HasColumnAnnotation (string name, object value);
override this.HasColumnAnnotation : string * obj -> System.Data.Entity.ModelConfiguration.Configuration.DateTimePropertyConfiguration
Public Function HasColumnAnnotation (name As String, value As Object) As DateTimePropertyConfiguration
參數
- name
- String
注釋名稱,必須是有效的 C#/EDM 識別碼。
- value
- Object
批註值,可以是字串或一些可使用 序列化的其他類型。 IMetadataAnnotationSerializer
傳回
相同的 DateTimePropertyConfiguration 實例,以便鏈結多個呼叫。
備註
如果批註值的型別不是字串,則可能需要註冊 IMetadataAnnotationSerializer 。 傳遞 Null 值會清除先前設定之資料行上具有指定名稱的任何批註。