Table of Contents

Class SplatMicrosoftExtensions

Namespace
Splat.Microsoft.Extensions.DependencyInjection
Assembly
Splat.Microsoft.Extensions.DependencyInjection.dll

Provides extension methods for integrating the Microsoft dependency injection system with Splat by configuring the application-wide dependency resolver.

public static class SplatMicrosoftExtensions
Inheritance
SplatMicrosoftExtensions

Remarks

These methods allow you to set or update the global dependency resolver used by Splat to leverage Microsoft.Extensions.DependencyInjection. Use these extensions to enable Splat services to be resolved from your application's IServiceCollection or IServiceProvider. Only one resolver can be active at a time; calling these methods will replace any existing resolver.

Methods

UseMicrosoftDependencyResolver(IServiceCollection)

Initializes an instance of MicrosoftDependencyResolver that overrides the default AppLocator.

public static void UseMicrosoftDependencyResolver(this IServiceCollection serviceCollection)

Parameters

serviceCollection IServiceCollection

The IServiceCollection.

UseMicrosoftDependencyResolver(IServiceProvider)

Initializes an instance of MicrosoftDependencyResolver that overrides the default AppLocator with a built IServiceProvider.

public static void UseMicrosoftDependencyResolver(this IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The IServiceProvider.

Remarks

If there is already a MicrosoftDependencyResolver serving as the Current, it'll instead update it to use the specified serviceProvider.