Annotatable.SetAnnotation Method

Definition

Overloads

SetAnnotation(String, 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)

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

SetAnnotation(String, Annotation)

Source:
Annotatable.cs
Source:
Annotatable.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);

Parameters

name
String

The key of the annotation to be added.

annotation
Annotation

The annotation to be set.

Returns

The annotation that was set.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

SetAnnotation(String, Object)

Source:
Annotatable.cs
Source:
Annotatable.cs
Source:
Annotatable.cs
Source:
Annotatable.cs
Source:
Annotatable.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.

Implements

Applies to

Entity Framework Core 5.0 and other versions
Product Versions
Entity Framework Core 2.1, 2.2, 3.0, 3.1, 5.0

SetAnnotation(String, Annotation, Annotation)

Source:
Annotatable.cs
Source:
Annotatable.cs
Source:
Annotatable.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 5.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0