Skip to content

Commit

Permalink
* README.markdown added Resole, BuildUp sections
Browse files Browse the repository at this point in the history
  • Loading branch information
GSerjo committed Feb 26, 2012
1 parent 99cae9c commit cb0be18
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions README.markdown
Expand Up @@ -10,9 +10,13 @@ Currently TikoContainer supports following features:
* Resolve type and inject dependencies
* Property injection
* BuildUp existing instance (inject dependencies)
* Clear IoC container

Using TikoContainer
-------------------

### Register type ###

Using TikContainer
==================

Register type thru Register<TFrom, TTo>() or Register<T>() methods. All type will be registered as Singleton.

Expand All @@ -21,12 +25,19 @@ Register type thru Register<TFrom, TTo>() or Register<T>() methods. All type wil
TikoContainer.Register<IUserAccountRepository, UserAccountRepository>();
TikoContainer.Register<PasswordManager>();
}

### Resolve by type ###

Resolve object by type. _userAccountRepository will be initialised with an instance of UserAccountRepository.

var _userAccountRepository = TikoContainer.Resolve<IUserAccountRepository>();


Resolve dependency thru property injection. UserAccountRepository and PasswordManager properties will be injected after call TikoContainer.Resolve<UserAccountManager>()
### Resolve with property injection ###

Resolve dependency thru property injection. UserAccountRepository and PasswordManager properties will be injected after call

TikoContainer.Resolve<UserAccountManager>()

public class UserAccountManager
{
Expand All @@ -45,6 +56,20 @@ Resolve dependency thru property injection. UserAccountRepository and PasswordMa
public PasswordManager PasswordManager { get; set; }
}

### Resolve dependencies of an exsisting object ###

UserAccountRepository and PasswordManager properties will be injected after BuildUp call.

var _userAccountManager = new UserAccountManager();
TikoContainer.BuildUp(_userAccountManager);

### Clear TikoContainer ###

Clear IoC container cache, all registered types will be removed.

TikoContainer.Clear();





Expand Down

0 comments on commit cb0be18

Please sign in to comment.