Class IServiceProviderBasicExtensions

Defines basic extensions for the System.IServiceProvider interface.

Inheritance
System.Object
IServiceProviderBasicExtensions
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public static class IServiceProviderBasicExtensions : Object

Methods

GetService<TInterface>(IServiceProvider)

Gets the service instance associated with the given interface.

Declaration
public static TInterface GetService<TInterface>(this IServiceProvider self)
    where TInterface : class
Parameters
Type Name Description
System.IServiceProvider self
Returns
Type Description
TInterface
Type Parameters
Name Description
TInterface
Remarks

Returns null if the service could not be found.

In This Article
Back to top Generated by DocFX