Share via


MutableAnnotatableExtensions.GetOrAddAnnotation Méthode

Définition

Obtient l’annotation existante avec une clé donnée ou ajoute une nouvelle annotation si elle n’existe pas.

public static Microsoft.EntityFrameworkCore.Infrastructure.Annotation GetOrAddAnnotation (this Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable annotatable, string annotationName, string value);
static member GetOrAddAnnotation : Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable * string * string -> Microsoft.EntityFrameworkCore.Infrastructure.Annotation
<Extension()>
Public Function GetOrAddAnnotation (annotatable As IMutableAnnotatable, annotationName As String, value As String) As Annotation

Paramètres

annotatable
IMutableAnnotatable

Objet auquel rechercher ou ajouter l’annotation.

annotationName
String

Clé de l’annotation à rechercher ou à ajouter.

value
String

Valeur à stocker dans l’annotation si une nouvelle est créée.

Retours

Annotation trouvée ou ajoutée.

S’applique à