Share via


IOptionsMonitorCache<TOptions> 接口

定义

IOptionsMonitor<TOptions> 用来缓存 TOptions 实例。

generic <typename TOptions>
 where TOptions : classpublic interface class IOptionsMonitorCache
public interface IOptionsMonitorCache<TOptions> where TOptions : class
type IOptionsMonitorCache<'Options (requires 'Options : null)> = interface
Public Interface IOptionsMonitorCache(Of TOptions)

类型参数

TOptions

正在请求的选项类型。

派生

方法

Clear()

从缓存中清除所有选项实例。

GetOrAdd(String, Func<TOptions>)

获取已命名的选项实例,或添加使用 createOptions 创建的新实例。

TryAdd(String, TOptions)

尝试向缓存添加新选项,如果该名称已存在,则将返回 false。

TryRemove(String)

尝试删除选项实例。

适用于