OutputCacheProviderCollection.Add(ProviderBase) 方法
定义
向输出缓存提供程序的集合中插入提供程序。Inserts a provider into the collection of output-cache providers.
public:
override void Add(System::Configuration::Provider::ProviderBase ^ provider);
public override void Add (System.Configuration.Provider.ProviderBase provider);
override this.Add : System.Configuration.Provider.ProviderBase -> unit
Public Overrides Sub Add (provider As ProviderBase)
参数
- provider
- ProviderBase
输出缓存提供程序。An output cache provider.
例外
provider 为 null。provider is null.
provider 的类型不是 OutputCacheProvider。provider is not of type OutputCacheProvider.
注解
Add方法只添加在网站的配置中指定的提供程序。The Add method adds only providers that are specified in the configuration for a Web site. 因此,它不会为内存中输出缓存添加 ASP.NET 默认提供程序。Therefore, it does not add the ASP.NET default provider for the in-memory output cache.
此集合为只读。This collection is read-only. 它基于在配置中指定的提供程序进行一次填充。It is populated one time based on the providers that are specified in configuration. 填充集合后,不能修改可用的提供程序集。After the collection is populated, you cannot modify the set of available providers.