Share via


IAnnotatable Interface

Definition

A class that exposes build-time and run-time annotations. Annotations allow for arbitrary metadata to be stored on an object.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

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
Derived
Implements

Remarks

See Implementation of database providers and extensions for more information and examples.

Properties

Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

Methods

AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

AnnotationsToDebugString(Int32)

Gets the debug string for all annotations declared on the object.

(Inherited from IReadOnlyAnnotatable)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

FindRuntimeAnnotationValue(String)

Gets the value of the runtime annotation with the given name, returning null if it does not exist.

GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from IReadOnlyAnnotatable)
GetAnnotations()

Gets all annotations on the current object.

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

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

Extension Methods

AnnotationsToDebugString(IAnnotatable, Int32)

Gets the debug string for all annotations declared on the object.

GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

Applies to