Flexberry ORM 8.0.0-beta01
|
Helper class for creating and using Unity containers. Подробнее...
Открытые статические члены | |
static IUnityContainer | CreateContainer () |
Creates new instance of Unity container and configures it using configuration file (from 'unity' section). Подробнее... | |
static IUnityContainer | GetContainer () |
Gets the singleton instance of Unity container. Подробнее... | |
Helper class for creating and using Unity containers.
You should avoid using this class when you can. Based on IoC / DI philosophy, you should create and configure you DI container at "composition root" of your application. Using singleton-based static approach is the best possible compromise for situations when you haven't got easy access to it (e.g. ASP.NET WebForms).
|
inlinestatic |
Creates new instance of Unity container and configures it using configuration file (from 'unity' section).
Using this method multiple times you'll get different instances of the container each time:
This behavior could be wrong when you want to use singleton (ContainerControlledLifetimeManager) because all lifetime managers work at separate containers (see documentation) and created dependency will live as long as your container.
For getting the same container use GetContainer.
|
inlinestatic |
Gets the singleton instance of Unity container.
The first instance will be created using CreateContainer.