语言

AnnotatableBuilder<TMetadata,TModelBuilder>.IConventionAnnotatableBuilder.HasAnnotation 方法

定义

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在且相同或更低 ConfigurationSource,则覆盖现有批注。

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

参数

name
String

要设置的批注的名称。

value
Object

要存储在批注中的值。

fromDataAnnotation
Boolean

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

返回

IConventionAnnotatableBuilder如果设置了批注,则为继续配置,null否则为继续配置。

实现

特性

适用于