Wiki

Clone wiki

ServiceResolver / DryIoc

Quick Start

Overview

ServiceResolver.DryIoc is the implementation of ServiceResolver for DryIoc

Implementation details

the following components are implemented.

  • ServiceRegisterProvider implements IServiceRegisterProvider, IDisposable, inherits ServiceRegisterImpl
  • ServiceRegisterImpl implements IServiceRegister, IGenericServiceProvider
  • ConditionalRegister<TService> implements IConditionalRegister<TService>
  • ServiceRegisterResolver<TCService> implements IServiceResolver<TCService>, inherits ServiceRegisterImpl

Getting Started

The easiest way to get started is by installing the available NuGet packages.

Quick Example

the unique thing to do is create an instance of ServiceRegisterProvider

#!c#
var serviceProvider = new ServiceRegisterProvider();

In some contexts, you need to apply an initializer to simple Injector container.

#!c#
var serviceProvider = new ServiceRegisterProvider(container =>
{
    container.With(rules => rules.WithUnknownServiceResolvers(Rules))
    // other customization for this container.
});

// Rules factory:
protected Factory Rules(Request request)
{
    // your logic here for Factory rules...
}

Once created the service provider, you can continue with registrations, see Home page for details.

Updated