Class Application
The standard implementation of the IApplication interface.
Inherited Members
Namespace: Encodo.Quino.App
Assembly: Quino.Application.Core.dll
Syntax
public class Application : IApplication, IServiceRegistrationHandler, IServiceRequestHandler, IDisposable
Properties
Bootstrap
Gets the bootstrap services for this application; cannot be null
.
Declaration
public IServiceRegistrationHandler Bootstrap { get; }
Property Value
Type | Description |
---|---|
IServiceRegistrationHandler |
Services
Gets the IOC services for this application; cannot be null
.
Declaration
public IServiceRequestHandler Services { get; }
Property Value
Type | Description |
---|---|
IServiceRequestHandler |
ShutdownActions
Gets the actions to apply in order to shut down this application.
Declaration
public INamedItemList<IApplicationAction> ShutdownActions { get; }
Property Value
Type | Description |
---|---|
INamedItemList<IApplicationAction> |
StartupActions
Gets the actions to apply in order to start this application.
Declaration
public INamedItemList<IApplicationAction> StartupActions { get; }
Property Value
Type | Description |
---|---|
INamedItemList<IApplicationAction> |
Methods
AddRegistration<TBaseService, TService>(IRegistration<TService>)
Declaration
public IServiceRegistrationHandler AddRegistration<TBaseService, TService>(IRegistration<TService> registration)
where TBaseService : class where TService : class, TBaseService
Parameters
Type | Name | Description |
---|---|---|
IRegistration<TService> | registration |
Returns
Type | Description |
---|---|
IServiceRegistrationHandler |
Type Parameters
Name | Description |
---|---|
TBaseService | |
TService |
CreateSingleRegistration<TService>()
Creates a registration for a singleton to use with AddRegistration<TService, TImplementation>(IRegistration<TImplementation>) to register the same object with multiple interfaces.
Declaration
public IRegistration<TService> CreateSingleRegistration<TService>()
where TService : class
Returns
Type | Description |
---|---|
IRegistration<TService> | A registration for a singleton to use with AddRegistration<TService, TImplementation>(IRegistration<TImplementation>) to register the same object with multiple interfaces. |
Type Parameters
Name | Description |
---|---|
TService |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
|
GetAllInstances(Type)
Gets all instances of type contractType
.
Declaration
public IEnumerable<object> GetAllInstances(Type contractType)
Parameters
Type | Name | Description |
---|---|---|
Type | contractType | Type of the service. |
Returns
Type | Description |
---|---|
IEnumerable<Object> | Returns a sequence of instances of the given |
Exceptions
Type | Condition |
---|---|
ActivationException | If a sequence of instances for the given |
GetFormattedDetails()
Gets the details of the contents of this container.
Declaration
public string GetFormattedDetails()
Returns
Type | Description |
---|---|
String | The details of the contents of this container. |
Remarks
This call will force verification of the container.
GetInstance(Type)
Gets an instance of the type contractType
.
Declaration
public object GetInstance(Type contractType)
Parameters
Type | Name | Description |
---|---|---|
Type | contractType | Type of the service. |
Returns
Type | Description |
---|---|
Object | An instance of the given |
Exceptions
Type | Condition |
---|---|
ActivationException | If an object for the given |
GetServices(IServiceRegistrationHandlerSettings)
Gets the services registered in this container.
Declaration
public IServiceRequestHandler GetServices(IServiceRegistrationHandlerSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationHandlerSettings | settings | The settings to use; cannot be |
Returns
Type | Description |
---|---|
IServiceRequestHandler | The services registered in this container; cannot be |
Remarks
This container is locked for further registration after this call.
GetUnderlyingContainer()
Gets the underlying container for advanced registration.
Declaration
public object GetUnderlyingContainer()
Returns
Type | Description |
---|---|
Object | The underlying container; cannot be |
Exceptions
Type | Condition |
---|---|
NotSupportedException | If no underlying container exists. |
Register<TService>(Func<TService>)
Declaration
public IServiceRegistrationHandler Register<TService>(Func<TService> createInstance)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
Func<TService> | createInstance |
Returns
Type | Description |
---|---|
IServiceRegistrationHandler |
Type Parameters
Name | Description |
---|---|
TService |
Register<TService, TImplementation>()
Registers that a new instance of TImplementation
will be returned every time a
TService
is requested.
Declaration
public IServiceRegistrationHandler Register<TService, TImplementation>()
where TService : class where TImplementation : class, TService
Returns
Type | Description |
---|---|
IServiceRegistrationHandler | This object. |
Type Parameters
Name | Description |
---|---|
TService | The type of the service. |
TImplementation | The type of the implementation. |
RegisterSingle<TConcrete>()
Registers a single concrete type, an instance of which will be constructed using constructor injection.
TImplementation
must be thread-safe.
Declaration
public IServiceRegistrationHandler RegisterSingle<TConcrete>()
where TConcrete : class
Returns
Type | Description |
---|---|
IServiceRegistrationHandler | This object. |
Type Parameters
Name | Description |
---|---|
TConcrete |
RegisterSingle<TService>(TService)
Declaration
public IServiceRegistrationHandler RegisterSingle<TService>(TService instance)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
TService | instance |
Returns
Type | Description |
---|---|
IServiceRegistrationHandler |
Type Parameters
Name | Description |
---|---|
TService |
RegisterSingle<TService>(Func<TService>)
Declaration
public IServiceRegistrationHandler RegisterSingle<TService>(Func<TService> createInstance)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
Func<TService> | createInstance |
Returns
Type | Description |
---|---|
IServiceRegistrationHandler |
Type Parameters
Name | Description |
---|---|
TService |
RegisterSingle<TService, TImplementation>()
Registers that the same instance of TImplementation
will be returned every time a
TService
is requested.
Declaration
public IServiceRegistrationHandler RegisterSingle<TService, TImplementation>()
where TService : class where TImplementation : class, TService
Returns
Type | Description |
---|---|
IServiceRegistrationHandler | This object. |
Type Parameters
Name | Description |
---|---|
TService | The type of the service. |
TImplementation | The type of the implementation. |
SetBootstrap(IServiceRegistrationHandler)
Sets the registration handler to use for Bootstrap.
Declaration
public void SetBootstrap(IServiceRegistrationHandler registrationHandler)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationHandler | registrationHandler | The registration handler to use; cannot be |
SetServices(IServiceRegistrationHandler)
Sets the registration handler to use with this application.
Declaration
public void SetServices(IServiceRegistrationHandler registrationHandler)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationHandler | registrationHandler | The registration handler to use; cannot be |