语言

ConventionAnnotatable.IConventionAnnotatable.SetOrRemoveAnnotation 方法

定义

设置存储在给定名称下的批注。 如果已存在具有指定名称的批注,则覆盖现有批注。 如果 null 已提供,则删除现有批注。

[System.Diagnostics.DebuggerStepThrough]
Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation IConventionAnnotatable.SetOrRemoveAnnotation(string name, object value, bool fromDataAnnotation);
[System.Diagnostics.DebuggerStepThrough]
Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation? IConventionAnnotatable.SetOrRemoveAnnotation(string name, object? value, bool fromDataAnnotation);
[<System.Diagnostics.DebuggerStepThrough>]
abstract member Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable.SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation
override this.Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable.SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation
Function SetOrRemoveAnnotation (name As String, value As Object, fromDataAnnotation As Boolean) As IConventionAnnotation Implements IConventionAnnotatable.SetOrRemoveAnnotation

参数

name
String

要添加的批注的名称。

value
Object

要存储在批注中的值。

fromDataAnnotation
Boolean

指示是否使用数据注释指定了配置。

返回

新批注或 null 已删除批注。

实现

特性

适用于