語言

IOptionsMonitorCache<TOptions>.TryAdd(String, TOptions) 方法

定義

嘗試在快取中新增一個選項。

public:
 bool TryAdd(System::String ^ name, TOptions options);
public bool TryAdd(string? name, TOptions options);
abstract member TryAdd : string * 'Options -> bool
Public Function TryAdd (name As String, options As TOptions) As Boolean

參數

name
String

選擇權實例的名稱。

options
TOptions

選項範例。

傳回

true 如果加入了期權實例; false 如果這個名字已經存在的話。

適用於