IConventionAnnotatableBuilder.SetOrRemoveAnnotation 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
Use HasNonNullAnnotation
設定或移除儲存在指定名稱下的批註。
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder SetOrRemoveAnnotation (string name, object value, bool fromDataAnnotation = false);
[System.Obsolete("Use HasNonNullAnnotation")]
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder? SetOrRemoveAnnotation (string name, object? value, bool fromDataAnnotation = false);
abstract member SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
[<System.Obsolete("Use HasNonNullAnnotation")>]
abstract member SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
override this.SetOrRemoveAnnotation : string * obj * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
Public Function SetOrRemoveAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false) As IConventionAnnotatableBuilder
Public Overridable Function SetOrRemoveAnnotation (name As String, value As Object, Optional fromDataAnnotation As Boolean = false) As IConventionAnnotatableBuilder
參數
- name
- String
要設定之批註的名稱。
- value
- Object
要儲存在批註中的值。 null
表示移除批註。
- fromDataAnnotation
- Boolean
指出是否使用資料批註來指定組態。
傳回
如果 IConventionAnnotatableBuilder 已設定或移除批註,則為繼續設定的 , null
否則為 。
- 屬性