Interface IReadOnlyAnnotatable
- Namespace
- Microsoft.EntityFrameworkCore.Infrastructure
- Assembly
- Microsoft.EntityFrameworkCore.dll
A class that supports 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 IReadOnlyAnnotatable
Remarks
See Implementation of database providers and extensions for more information and examples.
Properties
this[string]
Gets the value of the annotation with the given name, returning null if it does not exist.
object? this[string name] { get; }
Parameters
name
stringThe name of the annotation to find.
Property Value
- object
The value of the existing annotation if an annotation with the specified name already exists. Otherwise, null.
Methods
AnnotationsToDebugString(int)
Gets the debug string for all annotations declared on the object.
string AnnotationsToDebugString(int indent = 0)
Parameters
indent
intThe number of indent spaces to use before each new line.
Returns
- string
Debug string representation of all annotations.
FindAnnotation(string)
Gets the annotation with the given name, returning null if it does not exist.
IAnnotation? FindAnnotation(string name)
Parameters
name
stringThe name of the annotation to find.
Returns
- IAnnotation
The existing annotation if an annotation with the specified name already exists. Otherwise, null.
GetAnnotation(string)
Gets the annotation with the given name, throwing if it does not exist.
IAnnotation GetAnnotation(string annotationName)
Parameters
annotationName
stringThe key of the annotation to find.
Returns
- IAnnotation
The annotation with the specified name.
GetAnnotations()
Gets all annotations on the current object.
IEnumerable<IAnnotation> GetAnnotations()