Created
May 9, 2014 04:57
-
-
Save dschenkelman/5f417134279a7e3f584d to your computer and use it in GitHub Desktop.
Needle Container: Fluency and Mapping Types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needleContainer | |
.Map<IForceEnlightened>() | |
.To<Jedi>() | |
.WithId("Yoda") | |
.UsingLifetime(RegistrationLifetime.Singleton) | |
.Commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needleContainer | |
.Map<IForceEnlightened>() | |
.To<Jedi>() | |
.UsingLifetime(RegistrationLifetime.Singleton) | |
.Commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needleContainer | |
.Map<IForceEnlightened>() | |
.To<Jedi>() | |
.WithId("Jedi") | |
.Commit(); | |
needleContainer | |
.Map<IForceEnlightened>() | |
.To<Sith>() | |
.WithId("Sith") | |
.Commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INeedleContainer needleContainer = new NeedleContainer(); | |
needleContainer | |
.Map<IForceEnlightened>() // when we request an IForceEnlightened | |
.To<Jedi>() // provide a Jedi | |
.Commit(); // save the mapping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment