Exemplo n.º 1
0
        public void Configuration2(IAppBuilder appBuilder)
        {
            StructureMap.IContainer container = IoC.Initialize();

            container.AssertConfigurationIsValid();

            var types = container.WhatDoIHave();

            Debug.WriteLine(container.WhatDoIHave());

            HttpConfiguration httpConfiguration = new HttpConfiguration
            {
                DependencyResolver = new StructureMapWebApiDependencyResolver(container)
            };

            WebApiConfig.Register(httpConfiguration);

            appBuilder.UseWebApi(httpConfiguration);
        }
 public object Resolve(Type type)
 {
     try
     {
         return(container.GetInstance(type));
     }
     catch (StructureMapException ex)
     {
         string message = ex.Message + "\n" + container.WhatDoIHave();
         throw new Exception(message);
     }
 }
Exemplo n.º 3
0
 public string GetConfiguration()
 {
     return(_container.WhatDoIHave());
 }