Skip to content

Instantly share code, notes, and snippets.

@andrebaltieri
Created September 23, 2014 16:41
Show Gist options
  • Save andrebaltieri/29e0fe2382f2e35d7e42 to your computer and use it in GitHub Desktop.
Save andrebaltieri/29e0fe2382f2e35d7e42 to your computer and use it in GitHub Desktop.
// DI
var container = new UnityContainer();
container.RegisterType<IUserRepository, UserRepository>(new HierarchicalLifetimeManager());
container.RegisterType<ICustomerRepository, CustomerRepository>(new HierarchicalLifetimeManager());
config.DependencyResolver = new UnityResolver(container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment