From 59e5bf2585443f6b23c07fed9efefc21ec642b99 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 22 Jul 2021 19:48:43 -0400 Subject: [PATCH] holy shit it works --- .../Controllers/HomeController.cs | 2 +- BinaryDad.Coding/Pages/Error.cshtml | 26 --------------- BinaryDad.Coding/Pages/Error.cshtml.cs | 32 ------------------- BinaryDad.Coding/Pages/Index.cshtml.cs | 20 ------------ .../{Pages => Views/Home}/Index.cshtml | 4 +-- .../{Pages => Views}/Shared/_Layout.cshtml | 0 .../Shared/_ValidationScriptsPartial.cshtml | 0 .../{Pages => Views}/_ViewImports.cshtml | 1 - .../{Pages => Views}/_ViewStart.cshtml | 0 9 files changed, 2 insertions(+), 83 deletions(-) delete mode 100644 BinaryDad.Coding/Pages/Error.cshtml delete mode 100644 BinaryDad.Coding/Pages/Error.cshtml.cs delete mode 100644 BinaryDad.Coding/Pages/Index.cshtml.cs rename BinaryDad.Coding/{Pages => Views/Home}/Index.cshtml (96%) rename BinaryDad.Coding/{Pages => Views}/Shared/_Layout.cshtml (100%) rename BinaryDad.Coding/{Pages => Views}/Shared/_ValidationScriptsPartial.cshtml (100%) rename BinaryDad.Coding/{Pages => Views}/_ViewImports.cshtml (69%) rename BinaryDad.Coding/{Pages => Views}/_ViewStart.cshtml (100%) diff --git a/BinaryDad.Coding/Controllers/HomeController.cs b/BinaryDad.Coding/Controllers/HomeController.cs index 94472e8..07d2164 100644 --- a/BinaryDad.Coding/Controllers/HomeController.cs +++ b/BinaryDad.Coding/Controllers/HomeController.cs @@ -10,7 +10,7 @@ namespace BinaryDad.Coding.Controllers { public IActionResult Index() { - return Content("ok"); + return View(); } } } diff --git a/BinaryDad.Coding/Pages/Error.cshtml b/BinaryDad.Coding/Pages/Error.cshtml deleted file mode 100644 index 6f92b95..0000000 --- a/BinaryDad.Coding/Pages/Error.cshtml +++ /dev/null @@ -1,26 +0,0 @@ -@page -@model ErrorModel -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -@if (Model.ShowRequestId) -{ -

- Request ID: @Model.RequestId -

-} - -

Development Mode

-

- Swapping to the Development environment displays detailed information about the error that occurred. -

-

- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. -

diff --git a/BinaryDad.Coding/Pages/Error.cshtml.cs b/BinaryDad.Coding/Pages/Error.cshtml.cs deleted file mode 100644 index 2da2613..0000000 --- a/BinaryDad.Coding/Pages/Error.cshtml.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; - -namespace BinaryDad.Coding.Pages -{ - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - [IgnoreAntiforgeryToken] - public class ErrorModel : PageModel - { - public string RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - - private readonly ILogger _logger; - - public ErrorModel(ILogger logger) - { - _logger = logger; - } - - public void OnGet() - { - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; - } - } -} diff --git a/BinaryDad.Coding/Pages/Index.cshtml.cs b/BinaryDad.Coding/Pages/Index.cshtml.cs deleted file mode 100644 index c5f9371..0000000 --- a/BinaryDad.Coding/Pages/Index.cshtml.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; - -namespace BinaryDad.Coding.Pages -{ - public class IndexModel : PageModel - { - private readonly ILogger _logger; - - public IndexModel(ILogger logger) - { - _logger = logger; - } - - public void OnGet() - { - - } - } -} diff --git a/BinaryDad.Coding/Pages/Index.cshtml b/BinaryDad.Coding/Views/Home/Index.cshtml similarity index 96% rename from BinaryDad.Coding/Pages/Index.cshtml rename to BinaryDad.Coding/Views/Home/Index.cshtml index cb67e5c..d80e207 100644 --- a/BinaryDad.Coding/Pages/Index.cshtml +++ b/BinaryDad.Coding/Views/Home/Index.cshtml @@ -1,6 +1,4 @@ -@page -@model IndexModel -@{ +@{ ViewData["Title"] = "Home page"; } diff --git a/BinaryDad.Coding/Pages/Shared/_Layout.cshtml b/BinaryDad.Coding/Views/Shared/_Layout.cshtml similarity index 100% rename from BinaryDad.Coding/Pages/Shared/_Layout.cshtml rename to BinaryDad.Coding/Views/Shared/_Layout.cshtml diff --git a/BinaryDad.Coding/Pages/Shared/_ValidationScriptsPartial.cshtml b/BinaryDad.Coding/Views/Shared/_ValidationScriptsPartial.cshtml similarity index 100% rename from BinaryDad.Coding/Pages/Shared/_ValidationScriptsPartial.cshtml rename to BinaryDad.Coding/Views/Shared/_ValidationScriptsPartial.cshtml diff --git a/BinaryDad.Coding/Pages/_ViewImports.cshtml b/BinaryDad.Coding/Views/_ViewImports.cshtml similarity index 69% rename from BinaryDad.Coding/Pages/_ViewImports.cshtml rename to BinaryDad.Coding/Views/_ViewImports.cshtml index 21e6ec2..5bf5790 100644 --- a/BinaryDad.Coding/Pages/_ViewImports.cshtml +++ b/BinaryDad.Coding/Views/_ViewImports.cshtml @@ -1,3 +1,2 @@ @using BinaryDad.Coding -@namespace BinaryDad.Coding.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/BinaryDad.Coding/Pages/_ViewStart.cshtml b/BinaryDad.Coding/Views/_ViewStart.cshtml similarity index 100% rename from BinaryDad.Coding/Pages/_ViewStart.cshtml rename to BinaryDad.Coding/Views/_ViewStart.cshtml