-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates unity implementation to not use webactivator or a singleton a…
…ccessor
- Loading branch information
Showing
7 changed files
with
38 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
using Unity.AspNet.Mvc; | ||
using Microsoft.Web.Infrastructure.DynamicModuleHelper; | ||
using System.Configuration; | ||
using System.Web; | ||
using Unity.AspNet.Mvc; | ||
|
||
|
||
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Our.Umbraco.IoC.Unity.UnityActivator), "Start")] | ||
[assembly: WebActivatorEx.ApplicationShutdownMethod(typeof(Our.Umbraco.IoC.Unity.UnityActivator), "Shutdown")] | ||
[assembly: PreApplicationStartMethod(typeof(Our.Umbraco.IoC.Unity.UnityActivator), "Start")] | ||
|
||
namespace Our.Umbraco.IoC.Unity | ||
{ | ||
/// <summary>Provides the bootstrapping for integrating Unity with WebApi when it is hosted in ASP.NET</summary> | ||
static class UnityActivator | ||
public static class UnityActivator | ||
{ | ||
/// <summary>Integrates Unity when the application starts.</summary> | ||
public static void Start() | ||
{ | ||
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule)); | ||
} | ||
//If this flag exists and it's not 'true' then this container will be disabled. | ||
if (ConfigurationManager.AppSettings["Our.Umbraco.IoC.Unity.Enabled"] != null && ConfigurationManager.AppSettings["Our.Umbraco.IoC.Unity.Enabled"] != "true") | ||
return; | ||
|
||
/// <summary>Disposes the Unity container when the application is shut down.</summary> | ||
public static void Shutdown() | ||
{ | ||
var container = UnityConfig.GetConfiguredContainer(); | ||
container.Dispose(); | ||
DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule)); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
<%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %> | ||
|