Skip to content

Commit 47fe4d1

Browse files
Renames Key property to PrimaryKey
Updates code to use `PrimaryKey` instead of `Key` property in `SiteMapping` for identifying pages. This change improves clarity and consistency by using a more descriptive name for the primary key field.
1 parent 0eb0f5f commit 47fe4d1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

EssentialCSharp.Web/Controllers/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public IActionResult Index()
3030

3131
ViewBag.PageTitle = siteMapping.IndentLevel is 0 ? siteMapping.ChapterTitle + " " + siteMapping.RawHeading : siteMapping.RawHeading;
3232
ViewBag.NextPage = FlipPage(siteMapping!.ChapterNumber, siteMapping.PageNumber, true);
33-
ViewBag.CurrentPageKey = siteMapping.Key;
33+
ViewBag.CurrentPageKey = siteMapping.PrimaryKey;
3434
ViewBag.PreviousPage = FlipPage(siteMapping.ChapterNumber, siteMapping.PageNumber, false);
3535
ViewBag.HeadContents = headHtml;
3636
ViewBag.Contents = html;

EssentialCSharp.Web/Extensions/SiteMappingListExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using EssentialCSharp.Common;
2-
using System.Globalization;
1+
using System.Globalization;
32

43
namespace EssentialCSharp.Web.Extensions;
54

@@ -58,7 +57,7 @@ public static class SiteMappingListExtensions
5857
currentMappingCount++;
5958
}
6059
overallMappingCount++;
61-
if (siteMapping.Key == key)
60+
if (siteMapping.PrimaryKey == key)
6261
{
6362
currentPageFound = true;
6463
}

0 commit comments

Comments
 (0)