diff --git a/Directory.Packages.props b/Directory.Packages.props index f0671a80..13dba90d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,7 +2,7 @@ true false - 1.1.1.19562 + 1.1.1.19570 false diff --git a/EssentialCSharp.Web/Services/ChapterDescriptionService.cs b/EssentialCSharp.Web/Services/ChapterDescriptionService.cs index 48fa519c..f4cc60bb 100644 --- a/EssentialCSharp.Web/Services/ChapterDescriptionService.cs +++ b/EssentialCSharp.Web/Services/ChapterDescriptionService.cs @@ -16,10 +16,10 @@ public ChapterDescriptionService(IWebHostEnvironment environment) } using FileStream stream = File.OpenRead(path); - List entries = JsonSerializer.Deserialize>(stream) + List entries = JsonSerializer.Deserialize>(stream) ?? throw new InvalidDataException($"No chapter descriptions found in {path}"); Dictionary descriptions = new(StringComparer.OrdinalIgnoreCase); - foreach (ChapterDescription entry in entries) + foreach (SiteMappingDescription entry in entries) { foreach (string key in entry.Keys) { @@ -42,6 +42,4 @@ public string GetDescription(SiteMapping mapping) string heading = mapping.IndentLevel == 0 ? mapping.ChapterTitle : mapping.RawHeading; return $"Learn about {heading} in Essential C# with practical examples and explanations from the online C# guide."; } - - private sealed record ChapterDescription(List Keys, string Value); }