Share via


MutableAnnotatableExtensions.GetOrAddAnnotation Method

Definition

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

public static Microsoft.EntityFrameworkCore.Infrastructure.Annotation GetOrAddAnnotation (this Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable annotatable, string annotationName, string value);
static member GetOrAddAnnotation : Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable * string * string -> Microsoft.EntityFrameworkCore.Infrastructure.Annotation
<Extension()>
Public Function GetOrAddAnnotation (annotatable As IMutableAnnotatable, annotationName As String, value As String) As Annotation

Parameters

annotatable
IMutableAnnotatable

The object to find or add the annotation to.

annotationName
String

The key of the annotation to be found or added.

value
String

The value to be stored in the annotation if a new one is created.

Returns

The found or added annotation.

Applies to