AccessorExtensions.GetService<TService>(IInfrastructure<IServiceProvider>) Yöntem

Tanım

Öğesini IServiceProvider uygulayan bir türden açığa çıkarılan bir hizmet çözer IInfrastructure<T> .

IInfrastructure<T> , uygulama kodunda kullanılması amaçlanmayan ancak veritabanı sağlayıcıları tarafından yazılan genişletme yöntemlerinde kullanılabilen özellikleri gizlemek için kullanılır.

public static TService GetService<TService> (this Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> accessor);
[System.Diagnostics.DebuggerStepThrough]
public static TService GetService<TService> (this Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> accessor);
[System.Diagnostics.DebuggerStepThrough]
public static TService GetService<TService> (this Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> accessor) where TService : class;
static member GetService : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> -> 'Service
[<System.Diagnostics.DebuggerStepThrough>]
static member GetService : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> -> 'Service
[<System.Diagnostics.DebuggerStepThrough>]
static member GetService : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> -> 'Service (requires 'Service : null)
<Extension()>
Public Function GetService(Of TService) (accessor As IInfrastructure(Of IServiceProvider)) As TService
<Extension()>
Public Function GetService(Of TService As Class) (accessor As IInfrastructure(Of IServiceProvider)) As TService

Tür Parametreleri

TService

Çözümlenecek hizmetin türü.

Parametreler

accessor
IInfrastructure<IServiceProvider>

Hizmet sağlayıcısını açığa çıkaran nesne.

Döndürülenler

TService

İstenen hizmet.

Öznitelikler

Açıklamalar

Daha fazla bilgi için bkz. DbContext hizmetlerine erişme .

Şunlara uygulanır