Annotatable Annotatable 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 Annotatable : IMutableAnnotatable, IAnnotatable
Public Class Annotatable
    Implements IMutableAnnotatable, IAnnotatable
Inheritance
System.ObjectSystem.Object
AnnotatableAnnotatable
Implements

Properties

Item[String] Item(String)

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

public virtual object this[string name] { get; set; }
Public Overridable Property Item(name As String) As Object
Parameters
name
System.String System.String

The key of the annotation to find.

Value
System.Object System.Object

The value of the existing annotation if an annotation with the specified name already exists. Otherwise, null.

Methods

AddAnnotation(String, Annotation) AddAnnotation(String, Annotation)

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

protected virtual Annotation AddAnnotation(string name, Annotation annotation)
Protected Overridable Function AddAnnotation(name As String, annotation As Annotation) As Annotation
Parameters
name
System.String System.String

The key of the annotation to be added.

annotation
Annotation Annotation

The annotation to be added.

Returns

The added annotation.

AddAnnotation(String, Object) AddAnnotation(String, Object)

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

public virtual Annotation AddAnnotation(string name, object value)
Public Overridable Function AddAnnotation(name As String, value As Object) As Annotation
Parameters
name
System.String System.String

The key of the annotation to be added.

value
System.Object System.Object

The value to be stored in the annotation.

Returns

The newly added annotation.

CreateAnnotation(String, Object) CreateAnnotation(String, Object)

Creates a new annotation.

protected virtual Annotation CreateAnnotation(string name, object value)
Protected Overridable Function CreateAnnotation(name As String, value As Object) As Annotation
Parameters
name
System.String System.String

The key of the annotation.

value
System.Object System.Object

The value to be stored in the annotation.

Returns

The newly created annotation.

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

FindAnnotation(String) FindAnnotation(String)

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

public virtual Annotation FindAnnotation(string name)
Public Overridable Function FindAnnotation(name As String) As Annotation
Parameters
name
System.String System.String

The key of the annotation to find.

Returns

The existing annotation if an annotation with the specified name already exists. Otherwise, null.

GetAnnotations() GetAnnotations()

Gets all annotations on the current object.

public virtual IEnumerable<Annotation> GetAnnotations()
Public Overridable Function GetAnnotations As IEnumerable(Of Annotation)
Returns
System.Collections.Generic.IEnumerable<Annotation> System.Collections.Generic.IEnumerable(Of Annotation)

GetHashCode() GetHashCode()

Inherited from System.Object

GetOrAddAnnotation(String, Object) GetOrAddAnnotation(String, Object)

Adds an annotation to this object or returns the existing annotation if one with the specified name already exists.

public virtual Annotation GetOrAddAnnotation(string name, object value)
Public Overridable Function GetOrAddAnnotation(name As String, value As Object) As Annotation
Parameters
name
System.String System.String

The key of the annotation to be added.

value
System.Object System.Object

The value to be stored in the annotation.

Returns

The existing annotation if an annotation with the specified name already exists. Otherwise, the newly added annotation.

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

OnAnnotationSet(String, Annotation, Annotation) OnAnnotationSet(String, Annotation, Annotation)

Runs the corresponding conventions when an annotation was set or removed.

protected virtual Annotation OnAnnotationSet(string name, Annotation annotation, Annotation oldAnnotation)
Protected Overridable Function OnAnnotationSet(name As String, annotation As Annotation, oldAnnotation As Annotation) As Annotation
Parameters
name
System.String System.String

The key of the set annotation.

annotation
Annotation Annotation

The annotation set.

oldAnnotation
Annotation Annotation

The old annotation.

Returns

The annotation that was set.

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

RemoveAnnotation(String) RemoveAnnotation(String)

Removes the given annotation from this object.

public virtual Annotation RemoveAnnotation(string name)
Public Overridable Function RemoveAnnotation(name As String) As Annotation
Parameters
name
System.String System.String

The annotation to remove.

Returns

The annotation that was removed.

SetAnnotation(String, Annotation) SetAnnotation(String, Annotation)

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

protected virtual Annotation SetAnnotation(string name, Annotation annotation)
Protected Overridable Function SetAnnotation(name As String, annotation As Annotation) As Annotation
Parameters
name
System.String System.String

The key of the annotation to be added.

annotation
Annotation Annotation

The annotation to be set.

Returns

The annotation that was set.

ToString() ToString()

Inherited from System.Object

Explicit Interface Implementations

IAnnotatable.FindAnnotation(String) Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable.FindAnnotation(String)

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

IAnnotation IAnnotatable.FindAnnotation(string name)
Function Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable.FindAnnotation(name As String) As IAnnotation Implements IAnnotatable.FindAnnotation
Parameters
name
System.String System.String

The key of the annotation to find.

Returns

The existing annotation if an annotation with the specified name already exists. Otherwise, null.

IAnnotatable.GetAnnotations() Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable.GetAnnotations()

Gets all annotations on the current object.

IEnumerable<IAnnotation> IAnnotatable.GetAnnotations()
Function Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable.GetAnnotations As IEnumerable(Of IAnnotation) Implements IAnnotatable.GetAnnotations
Returns
System.Collections.Generic.IEnumerable<IAnnotation> System.Collections.Generic.IEnumerable(Of IAnnotation)