Skip to content

Commit de40e5e

Browse files
committed
[ASP.NET Core] Small code quality improvements
1 parent 852f618 commit de40e5e

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

ASP.NET Core/AspNetCoreTemplate.Common/GlobalConstants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{
33
public static class GlobalConstants
44
{
5+
public const string SystemName = "AspNetCoreTemplate";
6+
57
public const string AdministratorRoleName = "Administrator";
68
}
79
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AspNetCoreTemplate.Web.Areas.Administration.ViewModels.Dashboard
1+
namespace AspNetCoreTemplate.Web.ViewModels.Administration.Dashboard
22
{
33
public class IndexViewModel
44
{

ASP.NET Core/Web/AspNetCoreTemplate.Web/Areas/Administration/Controllers/DashboardController.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
namespace AspNetCoreTemplate.Web.Areas.Administration.Controllers
22
{
3-
using System.Threading.Tasks;
4-
53
using AspNetCoreTemplate.Services.Data;
6-
using AspNetCoreTemplate.Web.Areas.Administration.ViewModels.Dashboard;
4+
using AspNetCoreTemplate.Web.ViewModels.Administration.Dashboard;
75

86
using Microsoft.AspNetCore.Mvc;
97

ASP.NET Core/Web/AspNetCoreTemplate.Web/Areas/Administration/Views/Dashboard/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@model AspNetCoreTemplate.Web.Areas.Administration.ViewModels.Dashboard.IndexViewModel
1+
@model AspNetCoreTemplate.Web.ViewModels.Administration.Dashboard.IndexViewModel
22
@{
33
this.ViewData["Title"] = "Admin dashboard";
44
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
@{
1+
@using AspNetCoreTemplate.Common
2+
@{
23
this.ViewData["Title"] = "Home Page";
34
}
45

56
<div class="text-center">
6-
<h1 class="display-4">Welcome to AspNetCoreTemplate!</h1>
7+
<h1 class="display-4">Welcome to @GlobalConstants.SystemName!</h1>
78
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
89
</div>

ASP.NET Core/Web/AspNetCoreTemplate.Web/Views/Shared/_Layout.cshtml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<!DOCTYPE html>
1+
@using AspNetCoreTemplate.Common
2+
<!DOCTYPE html>
23
<html>
34
<head>
45
<meta charset="utf-8" />
56
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>@this.ViewData["Title"] - AspNetCoreTemplate</title>
7+
<title>@this.ViewData["Title"] - @GlobalConstants.SystemName</title>
78

89
<environment names="Development">
910
<link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" asp-append-version="true" />
@@ -18,7 +19,7 @@
1819
<header>
1920
<nav class="navbar navbar-expand-sm navbar-light bg-white border-bottom box-shadow mb-3">
2021
<div class="container">
21-
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">AspNetCoreTemplate</a>
22+
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">@GlobalConstants.SystemName</a>
2223
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
2324
aria-expanded="false" aria-label="Toggle navigation">
2425
<span class="navbar-toggler-icon"></span>
@@ -50,7 +51,7 @@
5051

5152
<footer class="border-top footer text-muted">
5253
<div class="container">
53-
&copy; @DateTime.Now.Year - AspNetCoreTemplate - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
54+
&copy; @DateTime.Now.Year - @GlobalConstants.SystemName - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
5455
</div>
5556
</footer>
5657

0 commit comments

Comments
 (0)