()
+ .FirstOrDefault();
+if (startupCheck is not null)
+{
+ startupCheck.IsReady = true;
+}
+
+app.Run();
+
+///
+/// Exposed so WebApplicationFactory<Program> can bootstrap the app
+/// from integration tests.
+///
+public partial class Program { }
diff --git a/netcore/src/SampleWebApp/Properties/launchSettings.json b/netcore/src/SampleWebApp/Properties/launchSettings.json
new file mode 100644
index 0000000..04e0a28
--- /dev/null
+++ b/netcore/src/SampleWebApp/Properties/launchSettings.json
@@ -0,0 +1,13 @@
+{
+ "profiles": {
+ "SampleWebApp": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:7001;http://localhost:5001",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/netcore/src/SampleWebApp/SampleWebApp.csproj b/netcore/src/SampleWebApp/SampleWebApp.csproj
new file mode 100644
index 0000000..9e7e0f5
--- /dev/null
+++ b/netcore/src/SampleWebApp/SampleWebApp.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/netcore/src/SampleWebApp/Views/Home/About.cshtml b/netcore/src/SampleWebApp/Views/Home/About.cshtml
new file mode 100644
index 0000000..8e20dd1
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Home/About.cshtml
@@ -0,0 +1,6 @@
+@{
+ ViewData["Title"] = "About";
+}
+
+@ViewData["Title"]
+@ViewBag.Message
diff --git a/netcore/src/SampleWebApp/Views/Home/CodeView.cshtml b/netcore/src/SampleWebApp/Views/Home/CodeView.cshtml
new file mode 100644
index 0000000..f4523f0
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Home/CodeView.cshtml
@@ -0,0 +1,6 @@
+@{
+ ViewData["Title"] = "Code View";
+}
+
+Code View
+View the source code for this application on GitHub.
diff --git a/netcore/src/SampleWebApp/Views/Home/Contact.cshtml b/netcore/src/SampleWebApp/Views/Home/Contact.cshtml
new file mode 100644
index 0000000..dd294ef
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewData["Title"] = "Contact";
+}
+
+@ViewData["Title"]
+
+ Support: support@example.com
+
diff --git a/netcore/src/SampleWebApp/Views/Home/Index.cshtml b/netcore/src/SampleWebApp/Views/Home/Index.cshtml
new file mode 100644
index 0000000..20393fa
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewData["Title"] = "Home";
+}
+
+
+
SampleMvcWebApp
+
ASP.NET Core 6 Migration
+
diff --git a/netcore/src/SampleWebApp/Views/Home/Internals.cshtml b/netcore/src/SampleWebApp/Views/Home/Internals.cshtml
new file mode 100644
index 0000000..fb3bb90
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Home/Internals.cshtml
@@ -0,0 +1,12 @@
+@model SampleWebApp.Models.InternalsInfo
+@{
+ ViewData["Title"] = "Internals";
+}
+
+Application Internals
+
+ - Worker threads
- @Model.WorkerThreads
+ - Available threads
- @Model.AvailableThreads
+ - Available memory
- @Model.AvailableMbytes MB
+ - Heap memory used
- @Model.HeapMemoryUsedKbytes KB
+
diff --git a/netcore/src/SampleWebApp/Views/Shared/_Layout.cshtml b/netcore/src/SampleWebApp/Views/Shared/_Layout.cshtml
new file mode 100644
index 0000000..020e2dc
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Shared/_Layout.cshtml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ @ViewData["Title"] - SampleWebApp
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+ @await RenderSectionAsync("Scripts", required: false)
+
+
diff --git a/netcore/src/SampleWebApp/Views/Shared/_ValidationScriptsPartial.cshtml b/netcore/src/SampleWebApp/Views/Shared/_ValidationScriptsPartial.cshtml
new file mode 100644
index 0000000..7d8dd3e
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/Shared/_ValidationScriptsPartial.cshtml
@@ -0,0 +1,2 @@
+
+
diff --git a/netcore/src/SampleWebApp/Views/_ViewImports.cshtml b/netcore/src/SampleWebApp/Views/_ViewImports.cshtml
new file mode 100644
index 0000000..d8681e7
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/_ViewImports.cshtml
@@ -0,0 +1,3 @@
+@using SampleWebApp
+@using SampleWebApp.Models
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/netcore/src/SampleWebApp/Views/_ViewStart.cshtml b/netcore/src/SampleWebApp/Views/_ViewStart.cshtml
new file mode 100644
index 0000000..820a2f6
--- /dev/null
+++ b/netcore/src/SampleWebApp/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
diff --git a/netcore/src/SampleWebApp/appsettings.Development.json b/netcore/src/SampleWebApp/appsettings.Development.json
new file mode 100644
index 0000000..d51c202
--- /dev/null
+++ b/netcore/src/SampleWebApp/appsettings.Development.json
@@ -0,0 +1,17 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Debug",
+ "Microsoft.AspNetCore": "Information",
+ "Microsoft.EntityFrameworkCore": "Information"
+ },
+ "Console": {
+ "FormatterName": "simple",
+ "FormatterOptions": {
+ "SingleLine": false,
+ "IncludeScopes": true,
+ "TimestampFormat": "HH:mm:ss.fff "
+ }
+ }
+ }
+}
diff --git a/netcore/src/SampleWebApp/appsettings.Production.json b/netcore/src/SampleWebApp/appsettings.Production.json
new file mode 100644
index 0000000..0c5f7bf
--- /dev/null
+++ b/netcore/src/SampleWebApp/appsettings.Production.json
@@ -0,0 +1,10 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Warning",
+ "Microsoft.AspNetCore": "Error",
+ "Microsoft.EntityFrameworkCore": "Error",
+ "SampleWebApp": "Information"
+ }
+ }
+}
diff --git a/netcore/src/SampleWebApp/appsettings.Staging.json b/netcore/src/SampleWebApp/appsettings.Staging.json
new file mode 100644
index 0000000..d7b2fc5
--- /dev/null
+++ b/netcore/src/SampleWebApp/appsettings.Staging.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning",
+ "Microsoft.EntityFrameworkCore": "Warning"
+ }
+ }
+}
diff --git a/netcore/src/SampleWebApp/appsettings.json b/netcore/src/SampleWebApp/appsettings.json
new file mode 100644
index 0000000..e5a44b0
--- /dev/null
+++ b/netcore/src/SampleWebApp/appsettings.json
@@ -0,0 +1,18 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning",
+ "Microsoft.EntityFrameworkCore": "Warning"
+ },
+ "Console": {
+ "FormatterName": "json",
+ "FormatterOptions": {
+ "SingleLine": true,
+ "IncludeScopes": true,
+ "TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffZ "
+ }
+ }
+ },
+ "AllowedHosts": "*"
+}
diff --git a/netcore/src/SampleWebApp/wwwroot/css/site.css b/netcore/src/SampleWebApp/wwwroot/css/site.css
new file mode 100644
index 0000000..b71897b
--- /dev/null
+++ b/netcore/src/SampleWebApp/wwwroot/css/site.css
@@ -0,0 +1,22 @@
+html {
+ font-size: 14px;
+}
+
+@media (min-width: 768px) {
+ html {
+ font-size: 16px;
+ }
+}
+
+.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
+ box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
+}
+
+html {
+ position: relative;
+ min-height: 100%;
+}
+
+body {
+ margin-bottom: 60px;
+}
diff --git a/netcore/src/SampleWebApp/wwwroot/js/site.js b/netcore/src/SampleWebApp/wwwroot/js/site.js
new file mode 100644
index 0000000..b24214c
--- /dev/null
+++ b/netcore/src/SampleWebApp/wwwroot/js/site.js
@@ -0,0 +1 @@
+// Site-wide JavaScript
diff --git a/netcore/tests/SampleWebApp.IntegrationTests/HomeControllerEndpointTests.cs b/netcore/tests/SampleWebApp.IntegrationTests/HomeControllerEndpointTests.cs
new file mode 100644
index 0000000..435673d
--- /dev/null
+++ b/netcore/tests/SampleWebApp.IntegrationTests/HomeControllerEndpointTests.cs
@@ -0,0 +1,76 @@
+using System.Net;
+using FluentAssertions;
+using Microsoft.AspNetCore.Mvc.Testing;
+using Xunit;
+
+namespace SampleWebApp.IntegrationTests;
+
+public class HomeControllerEndpointTests : IClassFixture>
+{
+ private readonly WebApplicationFactory _factory;
+
+ public HomeControllerEndpointTests(WebApplicationFactory factory)
+ {
+ _factory = factory;
+ }
+
+ public static IEnumerable