Skip to content

Commit

Permalink
adds custom mvc unity requirements to startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Jul 26, 2019
1 parent 504d361 commit f3277a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Our.Umbraco.IoC.Unity/UnityStartup.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down Expand Up @@ -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<FilterAttributeFilterProvider>().First());
FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(container));
}

/// <summary>
Expand Down

0 comments on commit f3277a0

Please sign in to comment.