语言

ConventionAnnotatable 类

定义

支持读取和写入约定批注的类型的基类。

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

[System.Runtime.CompilerServices.Nullable(0)]
public abstract class ConventionAnnotatable : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable, Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable
public abstract class ConventionAnnotatable : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable, Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable
[<System.Runtime.CompilerServices.Nullable(0)>]
type ConventionAnnotatable = class
    inherit Annotatable
    interface IConventionAnnotatable
    interface IReadOnlyAnnotatable
    interface IMutableAnnotatable
type ConventionAnnotatable = class
    inherit Annotatable
    interface IConventionAnnotatable
    interface IAnnotatable
    interface IMutableAnnotatable
type ConventionAnnotatable = class
    inherit Annotatable
    interface IConventionAnnotatable
    interface IReadOnlyAnnotatable
    interface IMutableAnnotatable
Public MustInherit Class ConventionAnnotatable
Inherits Annotatable
Implements IConventionAnnotatable
继承
ConventionAnnotatable
继承
ConventionAnnotatable
特性
实现

注解

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

构造函数

名称 说明
ConventionAnnotatable()

支持读取和写入约定批注的类型的基类。

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

属性

名称 说明
IsReadOnly

指示当前对象是否为只读。

(继承自 AnnotatableBase)
Item[String]

获取具有给定名称的值批注,如果不存在,则 null 返回该值。

(继承自 Annotatable)

方法

名称 说明
AddAnnotation(String, Annotation)

向此对象添加批注。 如果具有指定名称的批注已存在,则引发。

(继承自 Annotatable)
AddAnnotation(String, Object, ConfigurationSource)

使用给定的配置源向此对象添加具有给定键和值的批注。 如果具有指定名称的批注已存在,则引发。

AddAnnotation(String, Object)

向此对象添加批注。 如果具有指定名称的批注已存在,则引发。

(继承自 Annotatable)
AddAnnotations(IEnumerable<IAnnotation>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

向此对象添加运行时批注。 如果具有指定名称的批注已存在,则引发。

(继承自 AnnotatableBase)
AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果具有指定名称的批注已存在,则引发。

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
CreateAnnotation(String, Object)

创建新的批注。

CreateRuntimeAnnotation(String, Object)

创建新的运行时批注。

(继承自 AnnotatableBase)
EnsureMutable()

如果模型是只读的,则引发。

(继承自 Annotatable)
EnsureReadOnly()

如果模型不是只读的,则引发。

(继承自 Annotatable)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则 null 返回。

FindRuntimeAnnotation(String)

获取具有给定名称的运行时批注,如果不存在,则 null 返回。

(继承自 AnnotatableBase)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 AnnotatableBase)
GetAnnotations()

获取当前对象上的所有批注。

GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时批注的值,如果不存在,则添加它。

(继承自 AnnotatableBase)
GetRuntimeAnnotations()

获取当前对象上的所有运行时批注。

(继承自 AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

设置或删除批注时调用。

OnAnnotationSet(String, IConventionAnnotation, IConventionAnnotation)

设置或删除批注时调用。

RemoveAnnotation(String)

从此对象中删除给定批注。

RemoveRuntimeAnnotation(String)

从此对象中删除给定的运行时批注。

(继承自 AnnotatableBase)
SetAnnotation(String, Annotation, Annotation)

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

(继承自 Annotatable)
SetAnnotation(String, Object, ConfigurationSource)

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

SetAnnotation(String, Object)

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

SetAnnotation(String, Object)

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

(继承自 Annotatable)
SetOrRemoveAnnotation(String, Object, ConfigurationSource)

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

SetRuntimeAnnotation(String, Annotation, Annotation)

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

(继承自 AnnotatableBase)
SetRuntimeAnnotation(String, Object)

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

(继承自 AnnotatableBase)

显式接口实现

名称 说明
IAnnotatable.AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果具有指定名称的批注已存在,则引发。

(继承自 AnnotatableBase)
IAnnotatable.FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null。

(继承自 Annotatable)
IAnnotatable.FindRuntimeAnnotation(String)

获取具有给定名称的运行时批注,如果不存在,则 null 返回。

(继承自 AnnotatableBase)
IAnnotatable.GetAnnotations()

获取当前对象上的所有批注。

(继承自 Annotatable)
IAnnotatable.GetRuntimeAnnotations()

获取当前对象上的所有运行时批注。

(继承自 AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

从此对象中删除给定的运行时批注。

(继承自 AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

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

(继承自 AnnotatableBase)
IConventionAnnotatable.AddAnnotation(String, Object, Boolean)

向此对象添加批注。 如果具有指定名称的批注已存在,则引发。

IConventionAnnotatable.Builder

获取可用于配置此对象的生成器。

IConventionAnnotatable.FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则 null 返回。

IConventionAnnotatable.GetAnnotations()

获取当前对象上的所有批注。

IConventionAnnotatable.IsInModel

指示此对象是否在模型中,即尚未从一个模型中删除。

IConventionAnnotatable.RemoveAnnotation(String)

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

IConventionAnnotatable.SetAnnotation(String, Object, Boolean)

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

IConventionAnnotatable.SetOrRemoveAnnotation(String, Object, Boolean)

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

IMutableAnnotatable.AddAnnotation(String, Object)

向此对象添加批注。 如果具有指定名称的批注已存在,则引发。

(继承自 Annotatable)
IMutableAnnotatable.Item[String]

获取或设置具有给定名称的批注的值。

IMutableAnnotatable.RemoveAnnotation(String)

从此对象中删除给定批注。

(继承自 Annotatable)
IMutableAnnotatable.SetAnnotation(String, Object)

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

IMutableAnnotatable.SetOrRemoveAnnotation(String, Object)

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

(继承自 Annotatable)
IReadOnlyAnnotatable.FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则 null 返回。

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

获取当前对象上的所有批注。

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

获取具有给定名称的批注的值,如果不存在,则 null 返回该值。

(继承自 AnnotatableBase)

扩展方法

名称 说明
AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

向对象添加批注。

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

向对象添加批注。

AnnotationsToDebugString(IAnnotatable, Int32)

获取针对对象上声明的所有批注的调试字符串。

GetAnnotation(IAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetAnnotation(IConventionAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetAnnotation(IMutableAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetOrAddAnnotation(IMutableAnnotatable, String, String)

获取具有给定键的现有批注,或添加一个新批注(如果不存在)。

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

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

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

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

适用于