ResourceMonitoringServiceCollectionExtensions.AddResourceMonitoring 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddResourceMonitoring(IServiceCollection) |
設定並新增 IResourceMonitor 實作至服務集合。 |
AddResourceMonitoring(IServiceCollection, Action<IResourceMonitorBuilder>) |
設定並新增 IResourceMonitor 實作至服務集合。 |
AddResourceMonitoring(IServiceCollection)
設定並新增 IResourceMonitor 實作至服務集合。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddResourceMonitoring(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddResourceMonitoring (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddResourceMonitoring : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddResourceMonitoring (services As IServiceCollection) As IServiceCollection
參數
- services
- IServiceCollection
要加入監視器的相依性插入容器。
傳回
services
的值。
例外狀況
services
為 null
。
適用於
AddResourceMonitoring(IServiceCollection, Action<IResourceMonitorBuilder>)
設定並新增 IResourceMonitor 實作至服務集合。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddResourceMonitoring(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Diagnostics::ResourceMonitoring::IResourceMonitorBuilder ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddResourceMonitoring (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Diagnostics.ResourceMonitoring.IResourceMonitorBuilder> configure);
static member AddResourceMonitoring : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Diagnostics.ResourceMonitoring.IResourceMonitorBuilder> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddResourceMonitoring (services As IServiceCollection, configure As Action(Of IResourceMonitorBuilder)) As IServiceCollection
參數
- services
- IServiceCollection
要加入監視器的相依性插入容器。
- configure
- Action<IResourceMonitorBuilder>
委派以設定 IResourceMonitorBuilder。
傳回
services
的值。
例外狀況
services
或 configure
是 null
。