ModelStateDictionary.Remove 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Remove(KeyValuePair<String,ModelState>) |
從模型狀態字典中移除第一次出現的指定物件。 |
Remove(String) |
從模型狀態字典移除具有指定之索引鍵的項目。 |
Remove(KeyValuePair<String,ModelState>)
從模型狀態字典中移除第一次出現的指定物件。
public bool Remove (System.Collections.Generic.KeyValuePair<string,System.Web.Mvc.ModelState> item);
abstract member Remove : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> bool
override this.Remove : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> bool
Public Function Remove (item As KeyValuePair(Of String, ModelState)) As Boolean
參數
- item
- KeyValuePair<String,ModelState>
要從模型狀態字典移除的物件。
傳回
如果 item
已成功移除模型狀態字典,則為 true,否則為 false。 如果在 item
模型狀態字典中找不到 ,這個方法也會傳回 false。
實作
例外狀況
模型狀態字典為唯讀。
適用於
Remove(String)
從模型狀態字典移除具有指定之索引鍵的項目。
public bool Remove (string key);
abstract member Remove : string -> bool
override this.Remove : string -> bool
Public Function Remove (key As String) As Boolean
參數
- key
- String
要移除的項目索引鍵。
傳回
如果成功移除項目則為 true,否則為 false。 如果在 key
模型狀態字典中找不到 ,這個方法也會傳回 false。
實作
例外狀況
模型狀態字典為唯讀。
key
為 null。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應