共用方式為


DesignTimeServiceCollectionExtensions.AddEntityFrameworkDesignTimeServices 方法

定義

新增 Entity Framework Core 設計階段服務。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddEntityFrameworkDesignTimeServices (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter reporter = default, Func<IServiceProvider> applicationServiceProviderAccessor = default);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddEntityFrameworkDesignTimeServices (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter? reporter = default, Func<IServiceProvider>? applicationServiceProviderAccessor = default);
static member AddEntityFrameworkDesignTimeServices : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter * Func<IServiceProvider> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddEntityFrameworkDesignTimeServices (services As IServiceCollection, Optional reporter As IOperationReporter = Nothing, Optional applicationServiceProviderAccessor As Func(Of IServiceProvider) = Nothing) As IServiceCollection

參數

services
IServiceCollection

服務 IServiceCollection 將會新增至 。

reporter
Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter

用來報告設計階段訊息。

applicationServiceProviderAccessor
Func<IServiceProvider>

應用程式服務提供者的存取子。

傳回

services。 這可讓鏈結其他方法呼叫。

備註

如需詳細資訊和範例,請參閱 EF Core 設計階段服務

適用於