Table of Contents

Interface IDependencyService

Namespace
AnyProtocol.DependencyInjection.Abstraction
Assembly
AnyProtocol.DependencyInjection.Abstraction.dll

Defines operations for dependency service.

public interface IDependencyService

Methods

Add(Type, Type, ServiceLifetime)

Adds to the current configuration.

IDependencyService Add(Type serviceType, Type implementationType, ServiceLifetime lifetime)

Parameters

serviceType Type

The runtime type to resolve.

implementationType Type

The implementation type.

lifetime ServiceLifetime

The lifetime.

Returns

IDependencyService

The value produced by the operation.

AddTransient<TService, TImplementation>()

Provides the where implementation used by AnyProtocol applications.

IDependencyService AddTransient<TService, TImplementation>() where TService : class where TImplementation : class, TService

Returns

IDependencyService

Type Parameters

TService

The service type.

TImplementation

The implementation type.

Add<TService>(ServiceLifetime)

Provides the add<t service> implementation used by AnyProtocol applications.

IDependencyService Add<TService>(ServiceLifetime lifetime) where TService : class

Parameters

lifetime ServiceLifetime

The lifetime.

Returns

IDependencyService

Type Parameters

TService

The service type.

Add<TImplementation>(Type, Func<IDependencyResolver, TImplementation>, ServiceLifetime)

Adds to the current configuration.

IDependencyService Add<TImplementation>(Type serviceType, Func<IDependencyResolver, TImplementation> factory, ServiceLifetime lifetime)

Parameters

serviceType Type

The runtime type to resolve.

factory Func<IDependencyResolver, TImplementation>

The factory used to create the instance.

lifetime ServiceLifetime

The lifetime.

Returns

IDependencyService

The value produced by the operation.

Type Parameters

TImplementation

The implementation type.

Add<TImplementation>(TImplementation)

Provides the add<t implementation> implementation used by AnyProtocol applications.

IDependencyService Add<TImplementation>(TImplementation service) where TImplementation : class

Parameters

service TImplementation

The service.

Returns

IDependencyService

Type Parameters

TImplementation

The implementation type.

Add<TService, TImplementation>(ServiceLifetime)

Provides the where implementation used by AnyProtocol applications.

IDependencyService Add<TService, TImplementation>(ServiceLifetime lifetime) where TService : class where TImplementation : class, TService

Parameters

lifetime ServiceLifetime

The lifetime.

Returns

IDependencyService

Type Parameters

TService

The service type.

TImplementation

The implementation type.