Compartilhar via


ConventionAnnotatable Class

Definition

Base class for types that support reading and writing convention annotations.

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

public abstract class ConventionAnnotatable : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable, Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable
type ConventionAnnotatable = class
    inherit Annotatable
    interface IConventionAnnotatable
    interface IAnnotatable
    interface IMutableAnnotatable
type ConventionAnnotatable = class
    inherit Annotatable
    interface IConventionAnnotatable
    interface IReadOnlyAnnotatable
    interface IMutableAnnotatable
Public MustInherit Class ConventionAnnotatable
Inherits Annotatable
Implements IConventionAnnotatable
Inheritance
ConventionAnnotatable
Inheritance
ConventionAnnotatable
Implements

Remarks

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

Constructors

ConventionAnnotatable()

Properties

IsReadOnly

Indicates whether the current object is read-only.

(Inherited from AnnotatableBase)
Item[String]

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

(Inherited from Annotatable)

Methods

AddAnnotation(String, Annotation)

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

(Inherited from Annotatable)
AddAnnotation(String, Object, ConfigurationSource)

Adds a annotation with given key and value to this object using given configuration source. 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.

(Inherited from Annotatable)
AddAnnotations(IEnumerable<IAnnotation>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

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

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Object)

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

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
CreateAnnotation(String, Object)

Creates a new annotation.

CreateRuntimeAnnotation(String, Object)

Creates a new runtime annotation.

(Inherited from AnnotatableBase)
EnsureMutable()

Throws if the model is read-only.

(Inherited from Annotatable)
EnsureReadOnly()

Throws if the model is not read-only.

(Inherited from Annotatable)
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.

(Inherited from AnnotatableBase)
GetAnnotation(String)

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

(Inherited from AnnotatableBase)
GetAnnotations()

Gets all annotations on the current object.

GetOrAddAnnotation(String, Object)

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

(Inherited from Annotatable)
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.

(Inherited from AnnotatableBase)
GetRuntimeAnnotations()

Gets all runtime annotations on the current object.

(Inherited from AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

Called when an annotation was set or removed.

OnAnnotationSet(String, IConventionAnnotation, IConventionAnnotation)

Called when an annotation was set or removed.

RemoveAnnotation(String)

Removes the given annotation from this object.

RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)
RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
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.

(Inherited from Annotatable)
SetAnnotation(String, Annotation)

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

(Inherited from Annotatable)
SetAnnotation(String, Object, ConfigurationSource)

Sets the annotation with given key and value on this object using given configuration source. 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.

SetAnnotation(String, Object)

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

(Inherited from Annotatable)
SetOrRemoveAnnotation(String, Object, ConfigurationSource)

Sets the annotation with given key and value on this object using given configuration source. Removes the existing annotation if an annotation with the specified name already exists and value is null.

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.

(Inherited from AnnotatableBase)
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.

(Inherited from AnnotatableBase)

Explicit Interface Implementations

IAnnotatable.AddRuntimeAnnotation(String, Object)

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

(Inherited from AnnotatableBase)
IAnnotatable.FindAnnotation(String)

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

(Inherited from Annotatable)
IAnnotatable.FindRuntimeAnnotation(String)

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

(Inherited from AnnotatableBase)
IAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from Annotatable)
IAnnotatable.GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

(Inherited from AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
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.

(Inherited from AnnotatableBase)
IConventionAnnotatable.AddAnnotation(String, Object, Boolean)

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

IConventionAnnotatable.Builder

Gets the builder that can be used to configure this object.

IConventionAnnotatable.FindAnnotation(String)

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

IConventionAnnotatable.GetAnnotations()

Gets all annotations on the current object.

IConventionAnnotatable.IsInModel

Indicates whether this object is in a model, i.e. hasn't been removed from one.

IConventionAnnotatable.RemoveAnnotation(String)

Removes the annotation with the given name from this object.

IConventionAnnotatable.SetAnnotation(String, Object, Boolean)

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

IConventionAnnotatable.SetOrRemoveAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

IMutableAnnotatable.AddAnnotation(String, Object)

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

(Inherited from Annotatable)
IMutableAnnotatable.Item[String]

Gets or sets the value of the annotation with the given name.

IMutableAnnotatable.RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)
IMutableAnnotatable.SetAnnotation(String, Object)

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

IMutableAnnotatable.SetOrRemoveAnnotation(String, Object)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

(Inherited from Annotatable)
IReadOnlyAnnotatable.FindAnnotation(String)

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

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

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

(Inherited from AnnotatableBase)

Extension Methods

AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

Adds annotations to an object.

GetAnnotation(IConventionAnnotatable, String)

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

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

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.

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

Adds annotations to an object.

GetAnnotation(IMutableAnnotatable, String)

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

GetOrAddAnnotation(IMutableAnnotatable, String, String)

Gets the existing annotation with a given key, or adds a new annotation if one does not exist.

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

Applies to