AnnotatableBuilder<TMetadata,TModelBuilder>.HasNonNullAnnotation 方法

定义

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

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<TMetadata,TModelBuilder> HasNonNullAnnotation (string name, object value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
public virtual Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBuilder<TMetadata,TModelBuilder>? HasNonNullAnnotation (string name, object? value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
abstract member HasNonNullAnnotation : 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.HasNonNullAnnotation : 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 HasNonNullAnnotation (name As String, value As Object, configurationSource As ConfigurationSource) As AnnotatableBuilder(Of TMetadata, TModelBuilder)

参数

name
String

要设置的批注的键。

value
Object

要存储在批注中的值。

configurationSource
ConfigurationSource

要设置的批注的配置源。

返回

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

适用于