语言

AnnotatableBuilder<TMetadata,TModelBuilder> 类

定义

具有简单 API 图面的基类型,用于配置 ConventionAnnotatable。

此类型通常由数据库提供程序(和其他扩展)使用。 它通常不用于应用程序代码。

[System.Diagnostics.DebuggerDisplay("Builder {Metadata,nq}")]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class AnnotatableBuilder<TMetadata,TModelBuilder> : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder where TMetadata : ConventionAnnotatable where TModelBuilder : IConventionModelBuilder
[System.Diagnostics.DebuggerDisplay("Builder {Metadata,nq}")]
public abstract class AnnotatableBuilder<TMetadata,TModelBuilder> : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder where TMetadata : ConventionAnnotatable where TModelBuilder : IConventionModelBuilder
[<System.Diagnostics.DebuggerDisplay("Builder {Metadata,nq}")>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type AnnotatableBuilder<'Metadata, 'ModelBuilder (requires 'Metadata :> ConventionAnnotatable and 'ModelBuilder :> IConventionModelBuilder)> = class
    interface IConventionAnnotatableBuilder
[<System.Diagnostics.DebuggerDisplay("Builder {Metadata,nq}")>]
type AnnotatableBuilder<'Metadata, 'ModelBuilder (requires 'Metadata :> ConventionAnnotatable and 'ModelBuilder :> IConventionModelBuilder)> = class
    interface IConventionAnnotatableBuilder
Public MustInherit Class AnnotatableBuilder(Of TMetadata, TModelBuilder)
Implements IConventionAnnotatableBuilder

类型参数

TMetadata
TModelBuilder
继承
AnnotatableBuilder<TMetadata,TModelBuilder>
特性
实现

注解

有关详细信息和示例,请参阅 数据库提供程序和扩展的实现 。

构造函数

名称 说明
AnnotatableBuilder<TMetadata,TModelBuilder>(TMetadata, TModelBuilder)

创建 的新实例 AnnotatableBuilder<TMetadata,TModelBuilder>

属性

名称 说明
Metadata

获取正在配置的项。

ModelBuilder

获取模型生成器。

方法

名称 说明
CanRemoveAnnotation(String, ConfigurationSource)

返回一个值,该值指示是否可以使用此配置源删除具有给定名称的批注。

CanSetAnnotation(String, Object, ConfigurationSource)

返回一个值,该值指示是否可以从此配置源设置具有给定名称和值的批注。

HasAnnotation(String, Object, ConfigurationSource)

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

HasNoAnnotation(String, ConfigurationSource)

删除具有给定名称的任何批注。

HasNonNullAnnotation(String, Object, ConfigurationSource)

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

MergeAnnotationsFrom(TMetadata, ConfigurationSource)

从给定对象复制所有已配置的批注,覆盖任何现有批注。

MergeAnnotationsFrom(TMetadata)

从覆盖任何现有批注的给定对象复制所有显式配置的批注。

RemoveAnnotation(String, ConfigurationSource)
已过时.

删除具有给定名称的任何批注。

显式接口实现

名称 说明
IConventionAnnotatableBuilder.CanRemoveAnnotation(String, Boolean)

返回一个值,该值指示是否可以使用此配置源删除具有给定名称的批注。

IConventionAnnotatableBuilder.CanSetAnnotation(String, Object, Boolean)

返回一个值,该值指示是否可以从此配置源设置具有给定名称和值的批注。

IConventionAnnotatableBuilder.HasAnnotation(String, Object, Boolean)

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

IConventionAnnotatableBuilder.HasNoAnnotation(String, Boolean)

从此对象中删除具有给定名称的批注。

IConventionAnnotatableBuilder.HasNonNullAnnotation(String, Object, Boolean)

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

IConventionAnnotatableBuilder.Metadata

获取正在配置的可订阅项。

IConventionAnnotatableBuilder.ModelBuilder

获取模型生成器。

适用于