From a926e7b8fa0c21994d939b066af8ae690fe5e910 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 14 Jul 2015 15:38:47 +0100 Subject: [PATCH] Registering types as themselves. This enables scenarios where you want to instantiate a particular type without having to manually resolve all of its dependencies. --- src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs b/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs index c27e860e4..145f40f98 100644 --- a/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs +++ b/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs @@ -69,7 +69,7 @@ namespace Orchard.Environment.ShellBuilders { foreach (var interfaceType in item.Type.GetInterfaces() .Where(itf => typeof(IDependency).IsAssignableFrom(itf) && !typeof(IEventHandler).IsAssignableFrom(itf))) { - registration = registration.As(interfaceType); + registration = registration.As(interfaceType).AsSelf(); if (typeof(ISingletonDependency).IsAssignableFrom(interfaceType)) { registration = registration.InstancePerMatchingLifetimeScope("shell"); }