共用方式為


IConventionAnnotatableBuilder.SetOrRemoveAnnotation 方法

定義

警告

Use HasNonNullAnnotation

設定或移除儲存在指定名稱下的批註。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder? SetOrRemoveAnnotation (string name, object? value, bool fromDataAnnotation = false);
abstract member SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
[<System.Obsolete("Use HasNonNullAnnotation")>]
abstract member SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
override this.SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
Public Function SetOrRemoveAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false) As IConventionAnnotatableBuilder
Public Overridable Function SetOrRemoveAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false) As IConventionAnnotatableBuilder

參數

name
String

要設定之批註的名稱。

value
Object

要儲存在批註中的值。 null 表示移除批註。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

如果 IConventionAnnotatableBuilder 已設定或移除批註,則為繼續設定的 , null 否則為 。

屬性

適用於