Interface IMutableAnnotatable
- Namespace
- LinqToDB.Internal.Infrastructure
- Assembly
- linq2db.dll
A class that exposes annotations that can be modified. Annotations allow for arbitrary metadata to be stored on an object.
This interface is typically used by linq2db providers and extensions. It is generally not used in application code.
public interface IMutableAnnotatable : IReadOnlyAnnotatable
- Inherited Members
- Extension Methods
Properties
this[string]
Gets or sets the value of the annotation with the given name.
object? this[string name] { get; set; }
Parameters
namestringThe name of the annotation.
Property Value
- object
The value of the existing annotation if an annotation with the specified name already exists. Otherwise, null.
Methods
AddAnnotation(string, object?)
Adds an annotation to this object. Throws if an annotation with the specified name already exists.
IAnnotation AddAnnotation(string name, object? value)
Parameters
namestringThe name of the annotation to be added.
valueobjectThe value to be stored in the annotation.
Returns
- IAnnotation
The newly added annotation.
RemoveAnnotation(string)
Removes the given annotation from this object.
IAnnotation? RemoveAnnotation(string name)
Parameters
namestringThe name of the annotation to remove.
Returns
- IAnnotation
The annotation that was removed.
SetAnnotation(string, object?)
Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.
void SetAnnotation(string name, object? value)
Parameters
namestringThe name of the annotation to be added.
valueobjectThe value to be stored in the annotation.
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.
void SetOrRemoveAnnotation(string name, object? value)
Parameters
namestringThe name of the annotation to be added.
valueobjectThe value to be stored in the annotation.