IConventionAnnotatableBuilder.SetOrRemoveAnnotation Method

Definition

Caution

Use HasNonNullAnnotation

Sets or removes the annotation stored under the given name.

C#
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
C#
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
C#
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder? SetOrRemoveAnnotation (string name, object? value, bool fromDataAnnotation = false);

Parameters

name
String

The name of the annotation to be set.

value
Object

The value to be stored in the annotation. null to remove the annotations.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An IConventionAnnotatableBuilder to continue configuration if the annotation was set or removed, null otherwise.

Attributes

Applies to

Product Versions (Obsolete)
Entity Framework Core 3.0, 3.1 (5.0, 6.0)