Commit af4bd10

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-03-21 04:16:44
trying to get auto wiring working with autofac.
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@95 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent 61826be
Changed files (4)
trunk
product
trunk/product/MyMoney/boot/container/registration/wire_up_the_essential_services_into_the.cs
@@ -8,9 +8,9 @@ namespace MoMoney.boot.container.registration
 {
     internal class wire_up_the_essential_services_into_the : ICommand
     {
-        readonly WindsorDependencyRegistry registry;
+        readonly IContainerBuilder registry;
 
-        public wire_up_the_essential_services_into_the(WindsorDependencyRegistry registry)
+        public wire_up_the_essential_services_into_the(IContainerBuilder registry)
         {
             this.registry = registry;
         }
trunk/product/MyMoney/boot/container/wire_up_the_container.cs
@@ -4,7 +4,6 @@ using System.Reflection;
 using MoMoney.boot.container.registration;
 using MoMoney.Infrastructure.Container.Windsor;
 using MoMoney.Infrastructure.Container.Windsor.configuration;
-using MoMoney.Infrastructure.Logging;
 using MoMoney.Utility.Core;
 using MoMoney.Utility.Extensions;
 
@@ -15,8 +14,8 @@ namespace MoMoney.boot.container
         public void run()
         {
             var container = new WindsorContainerFactory().create();
-
             var registry = new WindsorDependencyRegistry(container);
+            //var registry = new AutofacDependencyRegistry();
             var specification = new ComponentExclusionSpecification();
             var configuration = new ComponentRegistrationConfiguration();
 
@@ -58,11 +57,11 @@ namespace MoMoney.boot.container
         {
             if (type.GetInterfaces().Length > 0)
             {
-                if (typeof(ILoggable).IsAssignableFrom(type))
+                //if (typeof(ILoggable).IsAssignableFrom(type))
                 {
                     //builder.proxy(h
                 }
-                else
+                //else
                 {
                     builder.transient(type.last_interface(), type);
                 }
trunk/product/MyMoney/Infrastructure/Container/Autofac/AutofacDependencyRegistry.cs
@@ -2,13 +2,14 @@ using System;
 using System.Collections.Generic;
 using Autofac;
 using Autofac.Builder;
+using MoMoney.Infrastructure.Container.Windsor;
 using MoMoney.Infrastructure.proxies;
 using MoMoney.Utility.Core;
 using MoMoney.Utility.Extensions;
 
 namespace MoMoney.Infrastructure.Container.Autofac
 {
-    internal class AutofacDependencyRegistry : IDependencyRegistry
+    internal class AutofacDependencyRegistry : IDependencyRegistry, IContainerBuilder
     {
         ContainerBuilder builder;
         Func<IContainer> container;
trunk/product/MyMoney/Infrastructure/Container/Windsor/IContainerBuilder.cs
@@ -4,7 +4,7 @@ using MoMoney.Utility.Core;
 
 namespace MoMoney.Infrastructure.Container.Windsor
 {
-    public interface IContainerBuilder
+    public interface IContainerBuilder : IDependencyRegistry
     {
         void singleton<Contract, Implementation>() where Implementation : Contract;
         void singleton<Contract>(Contract instance_of_the_contract);