Skip to content

Commit 732d405

Browse files
committed
Merge branch 'release/4.2.0'
2 parents 9122325 + 2806a5f commit 732d405

43 files changed

Lines changed: 1299 additions & 858 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace OnTopic.AspNetCore.Mvc.Host {
1111

12-
1312
/*============================================================================================================================
1413
| CLASS: PROGRAM
1514
\---------------------------------------------------------------------------------------------------------------------------*/

OnTopic.AspNetCore.Mvc.Host/Views/Shared/Components/PageLevelNavigation/Default.cshtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
<h2>PageLevelNavigation</h2>
44
<ul>
5-
@foreach (var topic in Model.NavigationRoot.Children) {
6-
<li><a href="@topic.WebPath">@(topic.ShortTitle?? topic.Title)</a></li>
5+
@if (Model.NavigationRoot != null) {
6+
foreach (var topic in Model.NavigationRoot.Children) {
7+
<li><a href="@topic.WebPath">@(topic.ShortTitle?? topic.Title)</a></li>
8+
}
79
}
810
</ul>
911

OnTopic.AspNetCore.Mvc.Tests/OnTopic.AspNetCore.Mvc.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
10-
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
11-
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
10+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
11+
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

OnTopic.AspNetCore.Mvc/Controllers/SitemapController.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Globalization;
9-
using System.IO;
109
using System.Linq;
11-
using System.Text;
1210
using System.Xml;
1311
using System.Xml.Linq;
12+
using Microsoft.AspNetCore.Mvc;
1413
using OnTopic.Internal.Diagnostics;
1514
using OnTopic.Repositories;
16-
using Microsoft.AspNetCore.Mvc;
15+
16+
#pragma warning disable CS0618 // Type or member is obsolete; supresses known issue with helper methods being moved to private
1717

1818
namespace OnTopic.AspNetCore.Mvc.Controllers {
1919

@@ -126,6 +126,7 @@ public virtual ActionResult Index(bool indent = false) {
126126
/// Given a root topic, generates an XML-formatted sitemap.
127127
/// </summary>
128128
/// <returns>The site's homepage view.</returns>
129+
[Obsolete("The GenerateSitemap() method should not be public. It will be marked private in OnTopic Library 5.0.")]
129130
public virtual XDocument GenerateSitemap(Topic rootTopic) =>
130131
new XDocument(
131132
new XElement(_sitemapNamespace + "urlset",
@@ -140,6 +141,7 @@ select AddTopic(topic)
140141
/// <summary>
141142
/// Given a <see cref="Topic"/>, adds it to a given <see cref="XmlNode"/>.
142143
/// </summary>
144+
[Obsolete("The AddTopic() method should not be public. It will be marked private in OnTopic Library 5.0.")]
143145
public IEnumerable<XElement> AddTopic(Topic topic) {
144146

145147
/*------------------------------------------------------------------------------------------------------------------------
@@ -217,4 +219,6 @@ from relatedTopic in topic.Relationships[relationship.Name]
217219
}
218220

219221
} //Class
220-
} //Namespace
222+
} //Namespace
223+
224+
#pragma warning restore CS0618 // Type or member is obsolete

OnTopic.AspNetCore.Mvc/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static IRouteBuilder MapTopicRoute(
8383
/// Adds an MVC route for handling OnTopic related requests, and maps it to the <see cref="TopicController"/> by default.
8484
/// </summary>
8585
/// <remarks>
86-
/// This is functionally identical to <see cref="MapTopicRoute(IRouteBuilder, string, string, string)"/>, except that it
86+
/// This is functionally identical to <see cref="MapTopicRoute(IRouteBuilder, String, String, String)"/>, except that it
8787
/// targets the <see cref="IEndpointRouteBuilder"/>, which is preferred in ASP.NET Core 3.
8888
/// </remarks>
8989
public static ControllerActionEndpointConventionBuilder MapTopicRoute(

OnTopic.AspNetCore.Mvc/TopicRepositoryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RouteData routeData
6363
| case particular routes aren't present. That said, if they are defined, but should be excluded from a fallback, then
6464
| that path does need to be defined—thus e.g. {area}/{controller}/{path}.
6565
\-----------------------------------------------------------------------------------------------------------------------*/
66-
var paths = new List<String?>() {
66+
var paths = new List<string?>() {
6767
cleanPath($"{rootTopic}/{path}"),
6868
cleanPath($"{area}/{controller}/{action}/{path}"),
6969
cleanPath($"{area}/{controller}/{path}"),

OnTopic.Data.Caching/CachedTopicRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ public CachedTopicRepository(ITopicRepository dataProvider) : base() {
183183
/*------------------------------------------------------------------------------------------------------------------------
184184
| Define variables
185185
\-----------------------------------------------------------------------------------------------------------------------*/
186-
var remainder = uniqueKey.Substring(sourceTopic.GetUniqueKey().Length + 1);
187-
var marker = remainder.IndexOf(":", StringComparison.Ordinal);
188-
var nextChild = (marker < 0) ? remainder : remainder.Substring(0, marker);
186+
var remainder = uniqueKey.Substring(sourceTopic.GetUniqueKey().Length + 1);
187+
var marker = remainder.IndexOf(":", StringComparison.Ordinal);
188+
var nextChild = (marker < 0) ? remainder : remainder.Substring(0, marker);
189189

190190
/*------------------------------------------------------------------------------------------------------------------------
191191
| Find topic

OnTopic.Data.Caching/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ The `CachedTopicRepository` provides an in-memory wrapper around an `ITopicRepos
44
[![OnTopic.Data.Caching package in Internal feed in Azure Artifacts](https://igniasoftware.feeds.visualstudio.com/_apis/public/Packaging/Feeds/46d5f49c-5e1e-47bb-8b14-43be6c719ba8/Packages/3dfb3a0a-c049-407d-959e-546f714dcd0f/Badge)](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=3dfb3a0a-c049-407d-959e-546f714dcd0f&preferRelease=true)
55
[![Build Status](https://igniasoftware.visualstudio.com/OnTopic/_apis/build/status/OnTopic-CI-V3?branchName=master)](https://igniasoftware.visualstudio.com/OnTopic/_build/latest?definitionId=7&branchName=master)
66

7+
### Contents
8+
- [Functionality](#functionality)
9+
- [Installation](#installation)
10+
- [Usage](#usage)
11+
712
## Functionality
813
When topics are requested, they are pulled from the cache, if they exist; otherwise, they are pulled from the underlying `ITopicRepository` implementation, and then cached. Similarly, when topics are e.g. saved, the updated versions are persisted to the underlying `ITopicRepository`, and then updated in the cache.
914

OnTopic.Data.Sql.Database/OnTopic.Data.Sql.Database.sqlproj

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@
6868
<Folder Include="Functions\" />
6969
<Folder Include="Stored Procedures\" />
7070
<Folder Include="Types" />
71+
<Folder Include="Utilities\" />
72+
<Folder Include="Utilities\Stored Procedures" />
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Build Include="Utilities\Schema.sql" />
76+
<Build Include="Utilities\Stored Procedures\GenerateNestedSet.sql" />
77+
<Build Include="Utilities\Stored Procedures\CompressHierarchy.sql" />
78+
<Build Include="Utilities\Stored Procedures\DisableForeignKeys.sql" />
79+
<Build Include="Utilities\Stored Procedures\ValidateHierarchy.sql" />
80+
<Build Include="Utilities\Stored Procedures\DeleteConsecutiveExtendedAttributes.sql" />
81+
<Build Include="Utilities\Stored Procedures\DeleteOrphanedLastModifiedAttributes.sql" />
82+
<Build Include="Utilities\Stored Procedures\DeleteConsecutiveAttributes.sql" />
83+
<Build Include="Utilities\Stored Procedures\ConsolidateVersions.sql" />
7184
</ItemGroup>
7285
<ItemGroup>
7386
<Build Include="Tables\ExtendedAttributes.sql" />
@@ -89,13 +102,9 @@
89102
<Build Include="Stored Procedures\UpdateRelationships.sql" />
90103
<Build Include="Stored Procedures\GetTopics.sql" />
91104
<Build Include="Stored Procedures\GetAttributes.sql" />
92-
<Build Include="Stored Procedures\GenerateNestedSet.sql" />
93105
<Build Include="Stored Procedures\DeleteTopic.sql" />
94106
<Build Include="Stored Procedures\CreateTopic.sql" />
95-
<Build Include="Stored Procedures\CompressHierarchy.sql" />
96-
<Build Include="Stored Procedures\pr_Disable_Foreign_Keys.sql" />
97107
<Build Include="Stored Procedures\GetTopicVersion.sql" />
98-
<Build Include="Stored Procedures\ValidateHierarchy.sql" />
99108
<Build Include="Types\AttributeValues.sql" />
100109
<Build Include="Types\TopicList.sql" />
101110
<Build Include="Views\AttributeIndex.sql" />
@@ -109,6 +118,7 @@
109118
</ItemGroup>
110119
<ItemGroup>
111120
<None Include="README.md" />
121+
<None Include="Utilities\README.md" />
112122
</ItemGroup>
113123
<ItemGroup>
114124
<RefactorLog Include="OnTopic.Data.Sql.Database.refactorlog" />

OnTopic.Data.Sql.Database/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# SQL Schema
22
The `OnTopic.Data.Sql.Database` provides a default schema for supporting the [`SqlTopicRepository`](../OnTopic.Data.Sql).
33

4-
> *Note:* Not all SQL objects are documented here. Missing objects are primarily intended for infrastructure support and used exclusively by stored procedures or administrators.
4+
> *Note:* In addition to the objects below—which are all part of the default `[dbo]` schema—there is also a [`[Utilities]`](Utilities/README.md) schema which provides stored procedures for use by administrators in maintening the database.
5+
6+
### Contents
7+
- [Tables](#tables)
8+
- [Stored Procedures](#stored-procedures)
9+
- [Querying](#querying)
10+
- [Updating](#updating)
11+
- [Functions](#functions)
12+
- [Views](#views)
13+
- [Types](#types)
514

615
## Tables
716
The following is a summary of the most relevant tables.
@@ -40,4 +49,4 @@ The majority of the views provide records corresponding to the latest version of
4049
## Types
4150
User-defined table valued types are used to relay arrays of information to (and between) the stored procedures. These can be mimicked in C# using e.g. a `DataTable`. These include:
4251
- **[`AttributeValues`](Types/AttributeValues.sql)**: Defines a table with an `AttributeKey` `Varchar(128)` and `AttributeValue` `Varchar(255)` columns.
43-
- **[`TopicList`](Types/TopicList.sql)**: Defines a table with a single `TopicId` `Int` column for passing lists of topics.
52+
- **[`TopicList`](Types/TopicList.sql)**: Defines a table with a single `TopicId` `Int` column for passing lists of topics.

0 commit comments

Comments
 (0)