Skip to content

Commit 42e5a33

Browse files
committed
IUnityContainer
1 parent e3ace67 commit 42e5a33

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

articles/using_unity.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ This topic describes how to develop applications using Unity, and how to create
66

77
Unity exposes very compact API to operate the container. The most operations related to registration, resolution, and lifetime management is exposed through one interface - **[IUnityContainer](xref:Unity.IUnityContainer)**.
88

9-
So, to start using Unity you need to create an instance of the container and get reference to [IUnityContainer](xref:Unity.IUnityContainer) interface:
9+
To start using Unity you need to create an instance of the container and get reference to [IUnityContainer](xref:Unity.IUnityContainer) interface:
1010

1111
```cs
1212
IUnityContainer container = new UnityContainer();
1313
```
1414

1515
## Creating instances
1616

17-
In basic scenario, once container is created you could immediately start using it:
17+
Once container is created you could start using it immediately:
1818

1919
```cs
20+
IUnityContainer container = new UnityContainer();
2021
var value = container.Resolve<object>();
22+
23+
// Calling Resolve<object>() is the same as
24+
value = new object();
2125
```
2226

2327
It will create any type with accessible constructor. Consider following example:

src/Abstractions

0 commit comments

Comments
 (0)