共用方式為


BinaryPropertyConfiguration.HasColumnAnnotation(String, Object) 方法

定義

針對用來儲存屬性的資料庫資料行,在模型中設定批註。 稍後可以在處理資料行時使用批註值,例如建立移轉時。

public System.Data.Entity.ModelConfiguration.Configuration.BinaryPropertyConfiguration HasColumnAnnotation (string name, object value);
override this.HasColumnAnnotation : string * obj -> System.Data.Entity.ModelConfiguration.Configuration.BinaryPropertyConfiguration
Public Function HasColumnAnnotation (name As String, value As Object) As BinaryPropertyConfiguration

參數

name
String

批註名稱,必須是有效的 C#/EDM 識別碼。

value
Object

批註值,可能是字串或一些可以使用 序列化的其他類型 IMetadataAnnotationSerializer

傳回

相同的 BinaryPropertyConfiguration 實例,以便鏈結多個呼叫。

備註

如果批註值的型別不是字串,則可能需要註冊 IMetadataAnnotationSerializer 。 傳遞 Null 值會清除先前設定之資料行上具有指定名稱的任何批註。

適用於