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 否则为 。

属性

适用于