OptionsCache<TOptions> 类

定义

用于缓存 TOptions 实例。Used to cache TOptions instances.

generic <typename TOptions>
 where TOptions : classpublic ref class OptionsCache : Microsoft::Extensions::Options::IOptionsMonitorCache<TOptions>
public class OptionsCache<TOptions> : Microsoft.Extensions.Options.IOptionsMonitorCache<TOptions> where TOptions : class
type OptionsCache<'Options (requires 'Options : null)> = class
    interface IOptionsMonitorCache<'Options (requires 'Options : null)>
Public Class OptionsCache(Of TOptions)
Implements IOptionsMonitorCache(Of TOptions)

类型参数

TOptions

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

继承
OptionsCache<TOptions>
实现

构造函数

OptionsCache<TOptions>()

方法

Clear()

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

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetOrAdd(String, Func<TOptions>)

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

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
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.

适用于