diff --git a/src/Our.Umbraco.IoC.Unity/UnityStartup.cs b/src/Our.Umbraco.IoC.Unity/UnityStartup.cs index d8b5696..ba5cc44 100644 --- a/src/Our.Umbraco.IoC.Unity/UnityStartup.cs +++ b/src/Our.Umbraco.IoC.Unity/UnityStartup.cs @@ -1,11 +1,12 @@ using System; using System.Configuration; +using System.Linq; using System.Web.Hosting; using System.Web.Http; using System.Web.Mvc; using Umbraco.Core; using Unity; - +using Unity.AspNet.Mvc; namespace Our.Umbraco.IoC.Unity { @@ -54,6 +55,9 @@ public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, Appl GlobalConfiguration.Configuration.DependencyResolver = new global::Unity.AspNet.WebApi.UnityDependencyResolver(container); DependencyResolver.SetResolver(new global::Unity.AspNet.Mvc.UnityDependencyResolver(container)); + //custom MVC requirements for unity + FilterProviders.Providers.Remove(FilterProviders.Providers.OfType().First()); + FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(container)); } ///