IOptionsMonitorCache<TOptions> 接口

定义

IOptionsMonitor<TOptions> 用来缓存 TOptions 实例。Used by IOptionsMonitor<TOptions> to cache TOptions instances.

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

请求的选项的类型。The type of options being requested.

派生

方法

Clear()

从缓存中清除所有选项实例。Clears all options instances from the cache.

GetOrAdd(String, Func<TOptions>)

获取已命名的选项实例,或添加使用 createOptions 创建的新实例。Gets a named options instance, or adds a new instance created with createOptions.

TryAdd(String, TOptions)

尝试向缓存添加新选项,如果该名称已存在,则将返回 false。Tries to adds a new option to the cache, will return false if the name already exists.

TryRemove(String)

尝试删除选项实例。Try to remove an options instance.

适用于