From 333540e5e848e711f4d347d8971d53074d465e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 22 Dec 2020 16:50:19 +0300 Subject: [PATCH] Added initial AbpPerfTest.WithAbp application. --- .../AbpPerfTest.WithAbp.csproj | 13 ++++++++ .../AbpPerfTest.WithAbp/AppModule.cs | 33 +++++++++++++++++++ .../AbpPerfTest.WithAbp/Program.cs | 21 ++++++++++++ .../Properties/launchSettings.json | 28 ++++++++++++++++ .../AbpPerfTest.WithAbp/Startup.cs | 18 ++++++++++ .../appsettings.Development.json | 9 +++++ .../AbpPerfTest.WithAbp/appsettings.json | 10 ++++++ test/AbpPerfTest/AbpPerfTest.sln | 6 ++++ 8 files changed, 138 insertions(+) create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/AbpPerfTest.WithAbp.csproj create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/Program.cs create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/Properties/launchSettings.json create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/Startup.cs create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.Development.json create mode 100644 test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.json diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/AbpPerfTest.WithAbp.csproj b/test/AbpPerfTest/AbpPerfTest.WithAbp/AbpPerfTest.WithAbp.csproj new file mode 100644 index 0000000000..41f8686caf --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/AbpPerfTest.WithAbp.csproj @@ -0,0 +1,13 @@ + + + + net5.0 + + + + + + + + + diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs b/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs new file mode 100644 index 0000000000..9c3de2cecf --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Hosting; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Autofac; +using Volo.Abp.EntityFrameworkCore.SqlServer; +using Volo.Abp.Modularity; + +namespace AbpPerfTest.WithAbp +{ + [DependsOn( + typeof(AbpAspNetCoreMvcModule), + typeof(AbpAutofacModule), + typeof(AbpEntityFrameworkCoreSqlServerModule) + )] + public class AppModule : AbpModule + { + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseConfiguredEndpoints(); + } + } +} diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/Program.cs b/test/AbpPerfTest/AbpPerfTest.WithAbp/Program.cs new file mode 100644 index 0000000000..37b8418e62 --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/Program.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace AbpPerfTest.WithAbp +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }) + .UseAutofac(); + } +} diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/Properties/launchSettings.json b/test/AbpPerfTest/AbpPerfTest.WithAbp/Properties/launchSettings.json new file mode 100644 index 0000000000..a5d1af3797 --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50732", + "sslPort": 44312 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "AbpPerfTest.WithAbp": { + "commandName": "Project", + "dotnetRunMessages": "true", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/Startup.cs b/test/AbpPerfTest/AbpPerfTest.WithAbp/Startup.cs new file mode 100644 index 0000000000..55d22b7dca --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/Startup.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; + +namespace AbpPerfTest.WithAbp +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app) + { + app.InitializeApplication(); + } + } +} diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.Development.json b/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.Development.json new file mode 100644 index 0000000000..8983e0fc1c --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.json b/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.json new file mode 100644 index 0000000000..d9d9a9bff6 --- /dev/null +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/test/AbpPerfTest/AbpPerfTest.sln b/test/AbpPerfTest/AbpPerfTest.sln index 56f079c284..b8baba19de 100644 --- a/test/AbpPerfTest/AbpPerfTest.sln +++ b/test/AbpPerfTest/AbpPerfTest.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbpPerfTest.WithoutAbp", "AbpPerfTest.WithoutAbp\AbpPerfTest.WithoutAbp.csproj", "{E3406CA0-9B0C-45FC-A3C0-8179A9C4A3E5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbpPerfTest.WithAbp", "AbpPerfTest.WithAbp\AbpPerfTest.WithAbp.csproj", "{13021286-B5D8-4A3E-8F36-5256D32638A7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,5 +14,9 @@ Global {E3406CA0-9B0C-45FC-A3C0-8179A9C4A3E5}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3406CA0-9B0C-45FC-A3C0-8179A9C4A3E5}.Release|Any CPU.ActiveCfg = Release|Any CPU {E3406CA0-9B0C-45FC-A3C0-8179A9C4A3E5}.Release|Any CPU.Build.0 = Release|Any CPU + {13021286-B5D8-4A3E-8F36-5256D32638A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13021286-B5D8-4A3E-8F36-5256D32638A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13021286-B5D8-4A3E-8F36-5256D32638A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13021286-B5D8-4A3E-8F36-5256D32638A7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal