Guest User

Untitled

a guest
Aug 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. How to make Castle Windsor container available in other classes etc?
  2. container.Resolve<ISomeThing>();
  3.  
  4. private static IWindsorContainer _container = new WindsorContainer();
  5.  
  6. private static void BootstrapContainer()
  7. {
  8.  
  9. _container = new WindsorContainer()
  10. .AddFacility<TypedFactoryFacility>()
  11. .Install(FromAssembly.This());
  12.  
  13. var controllerFactory = new WindsorControllerFactory(_container.Kernel);
  14. ControllerBuilder.Current.SetControllerFactory(controllerFactory);
  15. }
Add Comment
Please, Sign In to add comment