Updating autofac module

TODO: Need to upgrade the code which loads the autofac configuration from
the main config file, and also from tenant's satellite configs.

--HG--
branch : autofac3
This commit is contained in:
Sebastien Ros 2013-02-06 10:30:02 -08:00
parent f31bccac68
commit 05a499bc52
13 changed files with 479 additions and 263 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,5 +1,5 @@
Autofac IoC Container
Copyright (c) 2007-2010 Autofac Contributors
Copyright (c) 2007-2012 Autofac Contributors
http://code.google.com/p/autofac/wiki/Contributing
Other software included in this distribution is owned and

View File

@ -12,7 +12,7 @@ namespace Orchard.Tests.Stubs {
RequestLifetime.Dispose();
}
public IContainer ApplicationContainer { get; set; }
public ILifetimeScope ApplicationContainer { get; set; }
public ILifetimeScope RequestLifetime { get; set; }
}

View File

@ -119,13 +119,13 @@ namespace Orchard.Environment {
registrations(builder);
var autofacSection = ConfigurationManager.GetSection(ConfigurationSettingsReader.DefaultSectionName);
if (autofacSection != null)
builder.RegisterModule(new ConfigurationSettingsReader());
//var autofacSection = ConfigurationManager.GetSection(ConfigurationSettingsReader.DefaultSectionName);
//if (autofacSection != null)
// builder.RegisterModule(new ConfigurationSettingsReader());
var optionalHostConfig = HostingEnvironment.MapPath("~/Config/Host.config");
if (File.Exists(optionalHostConfig))
builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReader.DefaultSectionName, optionalHostConfig));
builder.RegisterModule(new ConfigurationSettingsReader(optionalHostConfig));
var optionalComponentsConfig = HostingEnvironment.MapPath("~/Config/HostComponents.config");
if (File.Exists(optionalComponentsConfig))

View File

@ -123,13 +123,13 @@ namespace Orchard.Environment.ShellBuilders {
// Register code-only registrations specific to a shell
_shellContainerRegistrations.Registrations(builder);
var optionalShellConfig = HostingEnvironment.MapPath("~/Config/Sites.config");
if (File.Exists(optionalShellConfig))
builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReader.DefaultSectionName, optionalShellConfig));
//var optionalShellConfig = HostingEnvironment.MapPath("~/Config/Sites.config");
//if (File.Exists(optionalShellConfig))
// builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReader.DefaultSectionName, optionalShellConfig));
var optionalShellByNameConfig = HostingEnvironment.MapPath("~/Config/Sites." + settings.Name + ".config");
if (File.Exists(optionalShellByNameConfig))
builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReader.DefaultSectionName, optionalShellByNameConfig));
//var optionalShellByNameConfig = HostingEnvironment.MapPath("~/Config/Sites." + settings.Name + ".config");
//if (File.Exists(optionalShellByNameConfig))
// builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReader.DefaultSectionName, optionalShellByNameConfig));
});
}