Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active July 1, 2016 02:55
Show Gist options
  • Select an option

  • Save rexcfnghk/89dcbe60a7b0ffd5f8557159b516359a to your computer and use it in GitHub Desktop.

Select an option

Save rexcfnghk/89dcbe60a7b0ffd5f8557159b516359a to your computer and use it in GitHub Desktop.
public class AppNinjectModule : NinjectModule
{
public override void Load()
{
// UserProfileManager is just a factory that manages the life cycle
// of UserProfile, because it has dependencies of its own (e.g. WCF
// service client)
Bind<UserProfile>()
.ToMethod(ctx => ctx.Get<UserProfileManager>().GetUserProfile())
.InRequestScope();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment