ServiceProvider
Wisej.Services.ServiceProvider
Last updated
Was this helpful?
Wisej.Services.ServiceProvider
Last updated
Was this helpful?
Namespace: Wisej.Services
Assembly: Wisej.Framework (4.0.0.0)
Manages services for Wisej.NET's DI implementation.
Registers or replaces a scoped service. Since 4.0.0
TService
The service to add.
Returns: ServiceProvider.
Throws:
InvalidOperationException A service of type TService is already registered.
Registers or replaces a scoped service. Since 4.0.0
serviceType
The type of the service to add.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers or replaces a scoped service. Since 4.0.0
TService
The type of the service to add.
TImplementation
The type of the implementation to use.
Returns: ServiceProvider.
Throws:
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 4.0.0
serviceType
The type of the service to add.
implementationType
The type of the implementation to use.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
ArgumentNullException implementationType is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers or replaces a scoped service. Since 4.0.0
TService
The type of the service to add.
implementationTypeName
The name of the type of the implementation; can be a fully qualified assembly + type name.
Returns: ServiceProvider.
Using this overload allows the application to register a service implementation that is loaded dynamically when requested. If implementationTypeName is a fully qualified type name, including the assembly name, the assembly and type are loaded on demand. Throws:
ArgumentNullException implementationTypeName is null or empty.
InvalidOperationException A service of type TService is already registered.
Registers or replaces a scoped service. Since 4.0.0
serviceType
The type of the service to add.
implementationTypeName
The name of the type of the implementation; can be a fully qualified assembly + type name.
Returns: ServiceProvider.
Using this overload allows the application to register a service implementation that is loaded dynamically when requested. If implementationTypeName is a fully qualified type name, including the assembly name, the assembly and type are loaded on demand. This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
ArgumentNullException implementationTypeName is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers or replaces a scoped service. Since 4.0.0
TService
The service to add.
serviceImplementation
Implementation for the TService .
Returns: ServiceProvider.
Throws:
ArgumentNullException serviceImplementation is null.
InvalidCastException serviceImplementation cannot be assigned to TService .
InvalidOperationException A service of type TService is already registered.
Registers or replaces a scoped service. Since 4.0.0
serviceType
The service to add.
serviceImplementation
Implementation for the serviceType .
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null.
ArgumentNullException serviceImplementation is null.
InvalidCastException serviceImplementation cannot be assigned to serviceType .
InvalidOperationException A service of type serviceType is already registered.
Registers or replaces a scoped service. Since 4.0.0
TService
The type of the service to add.
implementationFactory
Method for creating the TService instance.
Returns: ServiceProvider.
Throws:
NullReferenceException implementationFactory is null.
InvalidOperationException A service of type TService is already registered.
Registers or replaces a scoped service. Since 4.0.0
serviceType
The type of the service to add.
implementationFactory
Method for creating the serviceType instance.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
NullReferenceException serviceType is null.
NullReferenceException implementationFactory is null.
InvalidOperationException A service of type serviceType is already registered.
Registers a scoped service.
TService
The service to add.
Returns: ServiceProvider.
Throws:
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 3.5.4
serviceType
The type of the service to add.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers a scoped service.
TService
The type of the service to add.
TImplementation
The type of the implementation to use.
Returns: ServiceProvider.
Throws:
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 3.5.4
serviceType
The type of the service to add.
implementationType
The type of the implementation to use.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
ArgumentNullException implementationType is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers a scoped service.
TService
The type of the service to add.
implementationTypeName
The name of the type of the implementation; can be a fully qualified assembly + type name.
Returns: ServiceProvider.
Using this overload allows the application to register a service implementation that is loaded dynamically when requested. If implementationTypeName is a fully qualified type name, including the assembly name, the assembly and type are loaded on demand. Throws:
ArgumentNullException implementationTypeName is null or empty.
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 3.5.4
serviceType
The type of the service to add.
implementationTypeName
The name of the type of the implementation; can be a fully qualified assembly + type name.
Returns: ServiceProvider.
Using this overload allows the application to register a service implementation that is loaded dynamically when requested. If implementationTypeName is a fully qualified type name, including the assembly name, the assembly and type are loaded on demand. This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null or empty.
ArgumentNullException implementationTypeName is null or empty.
InvalidOperationException A service of type serviceType is already registered.
Registers a scoped service.
TService
The service to add.
serviceImplementation
Implementation for the TService .
Returns: ServiceProvider.
Throws:
ArgumentNullException serviceImplementation is null.
InvalidCastException serviceImplementation cannot be assigned to TService .
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 3.5.4
serviceType
The service to add.
serviceImplementation
Implementation for the serviceType .
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
ArgumentNullException serviceType is null.
ArgumentNullException serviceImplementation is null.
InvalidCastException serviceImplementation cannot be assigned to serviceType .
InvalidOperationException A service of type serviceType is already registered.
Registers a scoped service.
TService
The type of the service to add.
implementationFactory
Method for creating the TService instance.
Returns: ServiceProvider.
Throws:
NullReferenceException implementationFactory is null.
InvalidOperationException A service of type TService is already registered.
Registers a scoped service. Since 3.5.4
serviceType
The type of the service to add.
implementationFactory
Method for creating the serviceType instance.
Returns: ServiceProvider.
This non-generic method supports the registration of generic services:
Throws:
NullReferenceException serviceType is null.
NullReferenceException implementationFactory is null.
InvalidOperationException A service of type serviceType is already registered.
Returns the requested service.
T
Type of the service to retrieve.
Returns: T. An instance of T or null if the service is not found.
Returns the requested service.
serviceType
Type of the service to add.
Returns: Object. An instance of serviceType or null if the service is not found.
Throws:
ArgumentNullException serviceType is null.
Checks if a service of type T is already registered. Since 3.5.12
T
Service type to check.
Returns: Boolean. true if the service is registered.
Checks if a service of type serviceType is already registered. Since 3.5.12
serviceType
Service type to check.
Returns: Boolean. true if the service is registered.
Injects the services into the properties marked with the InjectAttribute attributed on the specified target object.
target
Target object to inject dependencies into.
Throws:
ArgumentNullException target is null.
Removes the specified service type from the service container.
TService
The service to remove.
Returns: ServiceProvider.
Removes the specified service type from the service container.
serviceType
Type of the service to remove.
Returns: ServiceProvider.
Throws:
ArgumentNullException serviceType is null.
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .
lifetime
Scope of the service. Default is .