Condividi tramite


ConventionAnnotatable.SetAnnotation Method

Definition

Overloads

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, 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)

Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs

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

public override void SetAnnotation (string name, object? value);
override this.SetAnnotation : string * obj -> unit
Public Overrides Sub SetAnnotation (name As String, value As Object)

Parameters

name
String

The key of the annotation to be added.

value
Object

The value to be stored in the annotation.

Applies to

SetAnnotation(String, Object, ConfigurationSource)

Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs
Source:
ConventionAnnotatable.cs

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.

public virtual Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation SetAnnotation (string name, object value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
public virtual Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation? SetAnnotation (string name, object? value, Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource configurationSource);
override this.SetAnnotation : string * obj * Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource -> Microsoft.EntityFrameworkCore.Metadata.Internal.ConventionAnnotation
Public Overridable Function SetAnnotation (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