public static void RegisterTypes(IUnityContainer container)
        {
            //var myAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.FullName.StartsWith("SelfHostWebApiOwin")).ToArray();

            container.RegisterType(typeof(Startup));
            UnityConfigRegistrations.RegisterTypesOwin(container);

            /*
             * container.RegisterTypes(
             *  UnityHelpers.GetTypesWithCustomAttribute<UnityIoCContainerControlledAttribute>(myAssemblies),
             *  WithMappings.FromMatchingInterface,
             *  WithName.Default,
             *  WithLifetime.ContainerControlled,
             *  null
             *  ).RegisterTypes(
             *           UnityHelpers.GetTypesWithCustomAttribute<UnityIoCTransientLifetimeAttribute>(myAssemblies),
             *           WithMappings.FromMatchingInterface,
             *           WithName.Default,
             *           WithLifetime.Transient);
             */
        }
Beispiel #2
0
 private static void RegisterTypes(UnityContainer container)
 {
     UnityConfigRegistrationsGenerated.RegisterTypes(container);
     UnityConfigRegistrations.RegisterTypes(container);
     GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
 }