AnnotatableBuilder<TMetadata,TModelBuilder>.HasAnnotation 方法

定义

使用给定的配置源在此对象上设置具有给定键和值的注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<TMetadata,TModelBuilder> HasAnnotation (string name, object value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
public virtual Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<TMetadata,TModelBuilder>? HasAnnotation (string name, object? value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
abstract member HasAnnotation : string * obj * Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource -> Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<'Metadata, 'ModelBuilder (requires 'Metadata :> Microsoft.EntityFrameworkCore.Infrastructure.ConventionAnnotatable and 'ModelBuilder :> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder)>
override this.HasAnnotation : string * obj * Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource -> Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<'Metadata, 'ModelBuilder (requires 'Metadata :> Microsoft.EntityFrameworkCore.Infrastructure.ConventionAnnotatable and 'ModelBuilder :> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder)>
Public Overridable Function HasAnnotation (name As String, value As Object, configurationSource As ConfigurationSource) As AnnotatableBuilder(Of TMetadata, TModelBuilder)

参数

name
String

要设置的批注的键。

value
Object

要存储在批注中的值。

configurationSource
ConfigurationSource

要设置的批注的配置源。

返回

同一生成器,以便可以链接多个调用。

适用于