Extract AspNetCore dependency to VAR.WebFormsCore.AspNetCore.
* Abstract HttpContext with IWebContext. * Move AspNetCore dependant code to isolated classes. * Downgrade VAR.WebFormsCore to netstandard2.0.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using VAR.WebFormsCore.Code;
|
||||
using VAR.WebFormsCore.Controls;
|
||||
using VAR.WebFormsCore.Pages;
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
namespace VAR.WebFormsCore.TestWebApp
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
using VAR.WebFormsCore.AspNetCore;
|
||||
|
||||
private static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
namespace VAR.WebFormsCore.TestWebApp;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
DefaultMain.WebFormCoreMain(args);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using VAR.WebFormsCore.Code;
|
||||
|
||||
namespace VAR.WebFormsCore.TestWebApp
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// If using Kestrel:
|
||||
services.Configure<KestrelServerOptions>(options =>
|
||||
{
|
||||
options.AddServerHeader = false;
|
||||
});
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseGlobalRouterMiddleware(env);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using VAR.WebFormsCore.Code;
|
||||
|
||||
namespace VAR.WebFormsCore.TestWebApp;
|
||||
@@ -14,12 +15,12 @@ public class TestWebAppGlobalConfig : IGlobalConfig
|
||||
public List<string> AllowedExtensions { get; } = new()
|
||||
{ ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
|
||||
|
||||
public bool IsUserAuthenticated(HttpContext context)
|
||||
public bool IsUserAuthenticated(IWebContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void UserDeauthenticate(HttpContext context)
|
||||
public void UserDeauthenticate(IWebContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VAR.WebFormsCore.AspNetCore\VAR.WebFormsCore.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user