Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 1.16 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Structure Map Error Code 202
  2. public static void Configure()
  3.     {
  4.         var log = LogManager.GetLogger(typeof (Global1));
  5.  
  6.         log.Debug("Initializing Container");
  7.         /*Initialize IoC Container*/
  8.         ObjectFactory.Initialize(x =>
  9.                                      {
  10.             x.For<ITokenService>().Use<TokenService>();
  11.             x.For<ILocalizationService>().Use<LocalizationService>();
  12.  
  13.             log.Debug("Initializing Object Factory");
  14.             /*Setup Property Injection*/
  15.             x.SetAllProperties(p =>
  16.                                    {
  17.                                        p.OfType<ITokenService>();
  18.                                        p.OfType<ILocalizationService>();
  19.                                    });
  20.         });
  21.  
  22.     }
  23.        
  24. public BasePage()
  25.     {
  26.         var log = LogManager.GetLogger(typeof (Global1));
  27.         log.Debug("Base Page Build Up");
  28.         /*Inject Dependencies*/
  29.         ObjectFactory.BuildUp(this);
  30.     }
  31.        
  32. protected void Application_Start(object sender, EventArgs e)
  33.     {
  34.  
  35.         log.Debug("In Application Start - Pre BuildUp");
  36.         /*Configure Ioc Container*/
  37.         IocConfigurator.Configure();
  38.     }