语言

IAnnotatable 接口

定义

公开生成时间和运行时批注的类。 批注允许将任意元数据存储在对象上。

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

public interface IAnnotatable
public interface IAnnotatable : Microsoft.EntityFrameworkCore.Infrastructure.IReadOnlyAnnotatable
type IAnnotatable = interface
type IAnnotatable = interface
    interface IReadOnlyAnnotatable
Public Interface IAnnotatable
Public Interface IAnnotatable
Implements IReadOnlyAnnotatable
派生
实现

注解

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

属性

名称 说明
Item[String]

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

方法

名称 说明
AddRuntimeAnnotation(String, Object)

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

AnnotationsToDebugString(Int32)

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

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

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

FindRuntimeAnnotation(String)

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

FindRuntimeAnnotationValue(String)

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

GetAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

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

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

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

GetRuntimeAnnotations()

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

RemoveRuntimeAnnotation(String)

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

SetRuntimeAnnotation(String, Object)

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

扩展方法

名称 说明
AnnotationsToDebugString(IAnnotatable, Int32)

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

GetAnnotation(IAnnotatable, String)

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

适用于