Introduce WebFinalComponent
This commit is contained in:
17
src/Umbraco.Web/Runtime/WebFinalComponent.cs
Normal file
17
src/Umbraco.Web/Runtime/WebFinalComponent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Web.Http;
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Web.Runtime
|
||||
{
|
||||
public class WebFinalComponent : IComponent
|
||||
{
|
||||
public void Initialize()
|
||||
{
|
||||
// ensure WebAPI is initialized, after everything
|
||||
GlobalConfiguration.Configuration.EnsureInitialized();
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
10
src/Umbraco.Web/Runtime/WebFinalComposer.cs
Normal file
10
src/Umbraco.Web/Runtime/WebFinalComposer.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Web.Runtime
|
||||
{
|
||||
// composes after absolutely everything else = last
|
||||
[ComposeAfter(typeof(IUserComposer))] // after IUserComposer, which comes after ICoreComposer, which comes after IRuntimeComposer
|
||||
[ComposeAfter(typeof(IComposer))] // after plain IComposer
|
||||
public class WebFinalComposer : ComponentComposer<WebFinalComponent>
|
||||
{ }
|
||||
}
|
||||
@@ -90,9 +90,6 @@ namespace Umbraco.Web.Runtime
|
||||
|
||||
// set routes
|
||||
CreateRoutes(_umbracoContextAccessor, _globalSettings, _surfaceControllerTypes, _apiControllerTypes);
|
||||
|
||||
// ensure WebAPI is initialized, after everything
|
||||
GlobalConfiguration.Configuration.EnsureInitialized();
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
|
||||
@@ -1186,6 +1186,8 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebViewPageExtensions.cs" />
|
||||
<Compile Include="Runtime\WebFinalComponent.cs" />
|
||||
<Compile Include="Runtime\WebFinalComposer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="JavaScript\Resources.resx">
|
||||
|
||||
Reference in New Issue
Block a user