共用方式為


CoreOptionsExtension.WithApplicationServiceProvider(IServiceProvider) 方法

定義

使用與這個實例相同的所有選項建立新的實例,但已變更指定的選項。 直接呼叫這個方法並不常見。 請改用 DbContextOptionsBuilder

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithApplicationServiceProvider (IServiceProvider applicationServiceProvider);
public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithApplicationServiceProvider (IServiceProvider? applicationServiceProvider);
abstract member WithApplicationServiceProvider : IServiceProvider -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
override this.WithApplicationServiceProvider : IServiceProvider -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
Public Overridable Function WithApplicationServiceProvider (applicationServiceProvider As IServiceProvider) As CoreOptionsExtension

參數

applicationServiceProvider
IServiceProvider

要變更的選項。

傳回

選項已變更的新實例。

適用於