AnnotatableBase.SetAnnotation Method

Definition

Overloads

SetAnnotation(String, Annotation, Annotation)

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

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

Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs

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

C#
protected virtual Microsoft.EntityFrameworkCore.Infrastructure.Annotation? SetAnnotation (string name, Microsoft.EntityFrameworkCore.Infrastructure.Annotation annotation, Microsoft.EntityFrameworkCore.Infrastructure.Annotation? oldAnnotation);

Parameters

name
String

The key of the annotation to be added.

annotation
Annotation

The annotation to be set.

oldAnnotation
Annotation

The annotation being replaced.

Returns

The annotation that was set.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 6.0, 7.0, 8.0, 9.0

SetAnnotation(String, Object)

Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs
Source:
AnnotatableBase.cs

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

C#
public virtual void SetAnnotation (string name, object? value);

Parameters

name
String

The key of the annotation to be added.

value
Object

The value to be stored in the annotation.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 6.0, 7.0, 8.0, 9.0