Annotatable Annotatable Class

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.

Syntax

Declaration

public class Annotatable : IMutableAnnotatable, IAnnotatablePublic Class Annotatable
    Implements IMutableAnnotatable, IAnnotatable

Inheritance Hierarchy

  • System.Object
    System.Object
  • Annotatable
    Annotatable

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Properties summary

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

Methods summary

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

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

Creates a new annotation.

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

Gets all annotations on the current object.

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

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

Removes the given annotation from this object.

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

Explicit Interface Implementations summary

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

Gets all annotations on the current object.

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.

    Property 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

      The annotation to be added.

    Returns

  • 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

  • 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

  • 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<T><Annotation>
      System.Collections.Generic.IEnumerable<T>(Of Annotation)
  • 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.

  • 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

    Returns

  • 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

  • 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

      The annotation to be set.

    Returns

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<T><IAnnotation>
      System.Collections.Generic.IEnumerable<T>(Of IAnnotation)

Details

Assembly

Microsoft.EntityFrameworkCore.dll