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

如果建立新的值,要儲存在批註中的值。

傳回

找到或加入的批註。

適用於