語言

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

如果新增註解,則要儲存在註解中的值。

傳回

找到或新增的註解。

適用於