AccessorExtensions.GetService 메서드

정의

오버로드

GetService(IInfrastructure<IServiceProvider>, Type)

를 구현하는 형식에서 노출된 에서 IServiceProvider 서비스를 확인합니다 IInfrastructure<T>.

GetService<TService>(IInfrastructure<IServiceProvider>)

를 구현하는 형식에서 노출된 에서 IServiceProvider 서비스를 확인합니다 IInfrastructure<T>.

GetService(IInfrastructure<IServiceProvider>, Type)

를 구현하는 형식에서 노출된 에서 IServiceProvider 서비스를 확인합니다 IInfrastructure<T>.

[System.Diagnostics.DebuggerStepThrough]
public static object GetService (this Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> accessor, Type serviceType);
[<System.Diagnostics.DebuggerStepThrough>]
static member GetService : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<IServiceProvider> * Type -> obj
<Extension()>
Public Function GetService (accessor As IInfrastructure(Of IServiceProvider), serviceType As Type) As Object

매개 변수

accessor
IInfrastructure<IServiceProvider>

서비스 공급자를 노출하는 개체입니다.

serviceType
Type

확인할 서비스 유형입니다.

반환

요청된 서비스입니다.

특성

설명

IInfrastructure<T> 는 애플리케이션 코드에서 사용되지 않지만 데이터베이스 공급자 등에서 작성한 확장 메서드에서 사용할 수 있는 속성을 숨기는 데 사용됩니다.

자세한 내용 및 예제 는 DbContext 서비스 액세스를 참조하세요.

적용 대상

GetService<TService>(IInfrastructure<IServiceProvider>)

를 구현하는 형식에서 노출된 에서 IServiceProvider 서비스를 확인합니다 IInfrastructure<T>.

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

형식 매개 변수

TService

확인할 서비스 유형입니다.

매개 변수

accessor
IInfrastructure<IServiceProvider>

서비스 공급자를 노출하는 개체입니다.

반환

TService

요청된 서비스입니다.

특성

설명

IInfrastructure<T> 는 애플리케이션 코드에서 사용되지 않지만 데이터베이스 공급자 등에서 작성한 확장 메서드에서 사용할 수 있는 속성을 숨기는 데 사용됩니다.

자세한 내용 및 예제 는 DbContext 서비스 액세스를 참조하세요.

적용 대상