Delen via


AnnotatableBase Class

Definition

Base class for types that support reading and writing annotations.

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

public class AnnotatableBase : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable
type AnnotatableBase = class
    interface IAnnotatable
    interface IReadOnlyAnnotatable
Public Class AnnotatableBase
Implements IAnnotatable
Inheritance
AnnotatableBase
Derived
Implements

Remarks

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

Constructors

AnnotatableBase()

Properties

IsReadOnly

Indicates whether the current object is read-only.

Item[String]

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

Methods

AddAnnotation(String, Annotation)

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

AddAnnotation(String, Object)

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

AddAnnotations(IEnumerable<IAnnotation>)

Adds annotations to this object.

AddAnnotations(IReadOnlyDictionary<String,Object>)

Adds annotations to this object.

AddRuntimeAnnotation(String, Annotation)

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

AddRuntimeAnnotation(String, Object)

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

AddRuntimeAnnotations(IEnumerable<Annotation>)

Adds runtime annotations to this object.

AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

Adds runtime annotations to this object.

CreateAnnotation(String, Object)

Creates a new annotation.

CreateRuntimeAnnotation(String, Object)

Creates a new runtime annotation.

EnsureMutable()

Throws if the model is read-only.

EnsureReadOnly()

Throws if the model is not read-only.

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.

GetAnnotation(String)

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

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 runtime annotations on the current object.

OnAnnotationSet(String, Annotation, Annotation)

Called when an annotation was set or removed.

RemoveAnnotation(String)

Removes the given annotation from this object.

RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

SetAnnotation(String, Annotation, Annotation)

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

SetAnnotation(String, Object)

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

SetRuntimeAnnotation(String, Annotation, Annotation)

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

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.

Explicit Interface Implementations

IAnnotatable.AddRuntimeAnnotation(String, Object)

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

IAnnotatable.FindRuntimeAnnotation(String)

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

IAnnotatable.GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

IAnnotatable.RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

IAnnotatable.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.

IReadOnlyAnnotatable.FindAnnotation(String)

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

IReadOnlyAnnotatable.GetAnnotations()

Gets all annotations on the current object.

IReadOnlyAnnotatable.Item[String]

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

Extension Methods

AnnotationsToDebugString(IAnnotatable, Int32)

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

Applies to