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
serviceTypeTypeThe runtime type to resolve.
implementationTypeTypeThe implementation type.
lifetimeServiceLifetimeThe 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
Type Parameters
TServiceThe service type.
TImplementationThe implementation type.
Add<TService>(ServiceLifetime)
Provides the add<t service> implementation used by AnyProtocol applications.
IDependencyService Add<TService>(ServiceLifetime lifetime) where TService : class
Parameters
lifetimeServiceLifetimeThe lifetime.
Returns
Type Parameters
TServiceThe 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
serviceTypeTypeThe runtime type to resolve.
factoryFunc<IDependencyResolver, TImplementation>The factory used to create the instance.
lifetimeServiceLifetimeThe lifetime.
Returns
- IDependencyService
The value produced by the operation.
Type Parameters
TImplementationThe implementation type.
Add<TImplementation>(TImplementation)
Provides the add<t implementation> implementation used by AnyProtocol applications.
IDependencyService Add<TImplementation>(TImplementation service) where TImplementation : class
Parameters
serviceTImplementationThe service.
Returns
Type Parameters
TImplementationThe 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
lifetimeServiceLifetimeThe lifetime.
Returns
Type Parameters
TServiceThe service type.
TImplementationThe implementation type.