语言

MutableAnnotatableExtensions.GetOrAddAnnotation 方法

定义

获取具有给定键的现有批注,或添加一个新批注(如果不存在)。

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

参数

annotatable
IMutableAnnotatable

要查找或添加批注的对象。

annotationName
String

要找到或添加的批注的键。

value
String

创建新批注时要存储在批注中的值。

返回

找到或添加的批注。

适用于