共用方式為


IStartup.ConfigureServices(IServiceCollection) 方法

定義

將服務註冊至 IServiceCollection

public:
 IServiceProvider ^ ConfigureServices(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public IServiceProvider ConfigureServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services);
abstract member ConfigureServices : Microsoft.Extensions.DependencyInjection.IServiceCollection -> IServiceProvider
Public Function ConfigureServices (services As IServiceCollection) As IServiceProvider

參數

services
IServiceCollection

要新增服務的 IServiceCollection

傳回

適用於