Added Web.Website

This commit is contained in:
Bjarke Berg
2020-02-24 10:51:48 +01:00
parent f398f578ea
commit 5517186cb7
13 changed files with 81 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ namespace Umbraco.Web.BackOffice.AspNetCore
throw new ArgumentNullException(nameof(builder));
}
return builder.UseMiddleware<UmbracoMiddleware>();
return builder.UseMiddleware<UmbracoBackOfficeMiddleware>();
}
}
}

View File

@@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Http;
namespace Umbraco.Web.BackOffice.AspNetCore
{
public class UmbracoMiddleware
public class UmbracoBackOfficeMiddleware
{
private readonly RequestDelegate _next;
public UmbracoMiddleware(RequestDelegate next)
public UmbracoBackOfficeMiddleware(RequestDelegate next)
{
_next = next;
}

View File

@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Umbraco.Web.BackOffice.AspNetCore;
using Umbraco.Web.Website.AspNetCore;
namespace Umbraco.Web.UI.BackOffice
@@ -18,6 +19,7 @@ namespace Umbraco.Web.UI.BackOffice
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddUmbracoWebsite();
services.AddUmbracoBackOffice();
}
@@ -29,7 +31,9 @@ namespace Umbraco.Web.UI.BackOffice
app.UseDeveloperExceptionPage();
}
app.UseUmbracoWebsite();
app.UseUmbracoBackOffice();
app.UseRouting();
app.UseEndpoints(endpoints =>

View File

@@ -2,10 +2,12 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Umbraco.Web.UI.BackOffice</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
<ProjectReference Include="..\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
using System;
using Microsoft.AspNetCore.Builder;
namespace Umbraco.Web.Website.AspNetCore
{
public static class UmbracoBackOfficeApplicationBuilderExtensions
{
public static IApplicationBuilder UseUmbracoWebsite(this IApplicationBuilder builder)
{
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}
return builder.UseMiddleware<UmbracoWebsiteMiddleware>();
}
}
}

View File

@@ -0,0 +1,21 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace Umbraco.Web.Website.AspNetCore
{
public class UmbracoWebsiteMiddleware
{
private readonly RequestDelegate _next;
public UmbracoWebsiteMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context)
{
// Call the next delegate/middleware in the pipeline
await _next(context);
}
}
}

View File

@@ -0,0 +1,13 @@
using Microsoft.Extensions.DependencyInjection;
namespace Umbraco.Web.Website.AspNetCore
{
public static class UmbracoBackOfficeServiceCollectionExtensions
{
public static IServiceCollection AddUmbracoWebsite(this IServiceCollection services)
{
return services;
}
}
}

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Abstractions\Umbraco.Abstractions.csproj" />
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -117,7 +117,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Examine.Lucene", "U
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.BackOffice", "Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj", "{9B95EEF7-63FE-4432-8C63-166BE9C1A929}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.UI.BackOffice", "Umbraco.Web.UI.BackOffice\Umbraco.Web.UI.BackOffice.csproj", "{DCDFE97C-5630-4F6F-855D-8AEEB96556A5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.UI.NetCore", "Umbraco.Web.UI.NetCore\Umbraco.Web.UI.NetCore.csproj", "{DCDFE97C-5630-4F6F-855D-8AEEB96556A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.Website", "Umbraco.Web.Website\Umbraco.Web.Website.csproj", "{5A246D54-3109-4D2B-BE7D-FC0787D126AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -183,6 +185,10 @@ Global
{DCDFE97C-5630-4F6F-855D-8AEEB96556A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCDFE97C-5630-4F6F-855D-8AEEB96556A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCDFE97C-5630-4F6F-855D-8AEEB96556A5}.Release|Any CPU.Build.0 = Release|Any CPU
{5A246D54-3109-4D2B-BE7D-FC0787D126AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A246D54-3109-4D2B-BE7D-FC0787D126AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A246D54-3109-4D2B-BE7D-FC0787D126AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A246D54-3109-4D2B-BE7D-FC0787D126AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE