Share via


ConventionAnnotatable.SetOrRemoveAnnotation Method

Definition

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.

public virtual Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation? SetOrRemoveAnnotation (string name, object? value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
abstract member SetOrRemoveAnnotation : string * obj * Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource -> Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation
override this.SetOrRemoveAnnotation : string * obj * Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource -> Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation
Public Overridable Function SetOrRemoveAnnotation (name As String, value As Object, configurationSource As ConfigurationSource) As ConventionAnnotation

Parameters

name
String

The key of the annotation to be added.

value
Object

The value to be stored in the annotation.

configurationSource
ConfigurationSource

The configuration source of the annotation to be set.

Returns

Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation

The new annotation.

Applies to