From 3690b4d639d029f167917df554298add98574ae6 Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Thu, 16 Feb 2023 09:38:30 -0500 Subject: [PATCH] remove unused models --- .../Controllers/HomeController.cs | 12 --------- WeatherDashboard.Web/Models/ErrorViewModel.cs | 9 ------- .../Views/Shared/Error.cshtml | 25 ------------------- .../Views/_ViewImports.cshtml | 1 - .../WeatherDashboard.Web.csproj | 4 +++ 5 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 WeatherDashboard.Web/Models/ErrorViewModel.cs delete mode 100644 WeatherDashboard.Web/Views/Shared/Error.cshtml diff --git a/WeatherDashboard.Web/Controllers/HomeController.cs b/WeatherDashboard.Web/Controllers/HomeController.cs index 817a26d..ee708d3 100644 --- a/WeatherDashboard.Web/Controllers/HomeController.cs +++ b/WeatherDashboard.Web/Controllers/HomeController.cs @@ -1,6 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using System.Diagnostics; -using WeatherDashboard.Web.Models; using WeatherDashboard.Web.Services; namespace WeatherDashboard.Web.Controllers @@ -21,15 +19,5 @@ namespace WeatherDashboard.Web.Controllers return View(weather); } - public IActionResult Privacy() - { - return View(); - } - - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - public IActionResult Error() - { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); - } } } \ No newline at end of file diff --git a/WeatherDashboard.Web/Models/ErrorViewModel.cs b/WeatherDashboard.Web/Models/ErrorViewModel.cs deleted file mode 100644 index b734602..0000000 --- a/WeatherDashboard.Web/Models/ErrorViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WeatherDashboard.Web.Models -{ - public class ErrorViewModel - { - public string? RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - } -} \ No newline at end of file diff --git a/WeatherDashboard.Web/Views/Shared/Error.cshtml b/WeatherDashboard.Web/Views/Shared/Error.cshtml deleted file mode 100644 index a1e0478..0000000 --- a/WeatherDashboard.Web/Views/Shared/Error.cshtml +++ /dev/null @@ -1,25 +0,0 @@ -@model ErrorViewModel -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

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

- Request ID: @Model.RequestId -

-} - -

Development Mode

-

- Swapping to Development environment will display more 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/WeatherDashboard.Web/Views/_ViewImports.cshtml b/WeatherDashboard.Web/Views/_ViewImports.cshtml index ca7c7f7..f3042c6 100644 --- a/WeatherDashboard.Web/Views/_ViewImports.cshtml +++ b/WeatherDashboard.Web/Views/_ViewImports.cshtml @@ -1,4 +1,3 @@ @using WeatherDashboard @using WeatherDashboard.Web -@using WeatherDashboard.Web.Models @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/WeatherDashboard.Web/WeatherDashboard.Web.csproj b/WeatherDashboard.Web/WeatherDashboard.Web.csproj index 4092d0f..d9e998b 100644 --- a/WeatherDashboard.Web/WeatherDashboard.Web.csproj +++ b/WeatherDashboard.Web/WeatherDashboard.Web.csproj @@ -14,4 +14,8 @@ + + + +