IConventionAnnotatable.SetAnnotation(String, Object, Boolean) 方法

定义

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

public void SetAnnotation (string name, object value, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation SetAnnotation (string name, object value, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation? SetAnnotation (string name, object? value, bool fromDataAnnotation = false);
abstract member SetAnnotation : string * obj * bool -> unit
abstract member SetAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotation
Public Sub SetAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false)
Public Function SetAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false) As IConventionAnnotation

参数

name
String

要设置的批注的名称。

value
Object

要存储在批注中的值。

fromDataAnnotation
Boolean

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

返回

新批注。

适用于