Skip to content

Commit a4e8598

Browse files
committed
Merge branch 'release/5.1.0' into master
OnTopic 5.1.0 is a minor release which introduces support for mapping constructor parameters (#35) and defining what model to use when mapping associations via the `[MapAs()]` attribute (#41). Primarily, however, it is focused on bug fixes, and resolves a number of priority issues, such as an exception which occurs when deleting topics with associations (#47), topics with deleted references being treated as _unresolved_ (#46), and the inability to move a first child to another parent (#76). Finally, it also includes a number of improvements, such as checking type compatibility before mapping an association (#83), migrating the unit tests to xUnit.net (#66), and establishing integration tests for ASP.NET Core (#39). For a full rollup of new features, improvements, and bug fixes, see Pull Request #85.
2 parents c27e6a2 + 34084fd commit a4e8598

File tree

241 files changed

+9568
-2640
lines changed

Some content is hidden

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

241 files changed

+9568
-2640
lines changed

Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<UseFullSemVerForNuGet>true</UseFullSemVerForNuGet>
1717
<NeutralLanguage>en</NeutralLanguage>
1818
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1920
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2021
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2122
<GenerateDocumentationFile>true</GenerateDocumentationFile>

OnTopic.All/OnTopic.All.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.6">
14+
<PackageReference Include="GitVersion.MsBuild" Version="5.6.8">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>
@@ -25,4 +25,4 @@
2525
<ProjectReference Include="..\OnTopic\OnTopic.csproj" />
2626
</ItemGroup>
2727

28-
</Project>
28+
</Project>

OnTopic.All/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OnTopic Metapackage
22
The `OnTopic.All` metapackage includes a reference to the core OnTopic libraries that most implementations will require. It is recommended that implementers reference this package instead of referencing each of the OnTopic packages individually, unless they have a specific need to customize which packages are referenced.
33

4-
[![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)
4+
[![OnTopic.All package in Internal feed in Azure Artifacts](https://igniasoftware.feeds.visualstudio.com/_apis/public/Packaging/Feeds/46d5f49c-5e1e-47bb-8b14-43be6c719ba8/Packages/fe6dc001-649a-4442-8bf1-2af736c03b08/Badge)](https://www.nuget.org/packages/OnTopic.All/)
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
![NuGet Deployment Status](https://rmsprodscussu1.vsrm.visualstudio.com/A09668467-721c-4517-8d2e-aedbe2a7d67f/_apis/public/Release/badge/bd7f03e0-6fcf-4ec6-939d-4e995668d40f/2/2)
77

@@ -26,6 +26,4 @@ Installation can be performed by providing a `<PackageReference /`> to the `OnTo
2626
<PackageReference Include="OnTopic.All" Version="5.0.0" />
2727
</ItemGroup>
2828
</Project>
29-
```
30-
31-
> *Note:* This package is currently only available on Ignia's private **NuGet** repository. For access, please contact [Ignia](http://www.ignia.com/).
29+
```

OnTopic.AspNetCore.Mvc.Host/Components/MenuViewComponent.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6+
using System.Diagnostics.CodeAnalysis;
67
using Microsoft.AspNetCore.Mvc;
78
using OnTopic.AspNetCore.Mvc.Components;
89
using OnTopic.AspNetCore.Mvc.Controllers;
@@ -28,6 +29,7 @@ namespace OnTopic.AspNetCore.Mvc.Host.Components {
2829
/// cref="TopicController"/>.
2930
/// </para>
3031
/// </remarks>
32+
[ExcludeFromCodeCoverage]
3133
public class MenuViewComponent : MenuViewComponentBase<NavigationTopicViewModel> {
3234

3335
/*==========================================================================================================================

OnTopic.AspNetCore.Mvc.Host/Components/PageLevelNavigationViewComponent.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6+
using System.Diagnostics.CodeAnalysis;
67
using Microsoft.AspNetCore.Mvc;
78
using OnTopic.AspNetCore.Mvc.Components;
89
using OnTopic.AspNetCore.Mvc.Controllers;
@@ -27,6 +28,7 @@ namespace OnTopic.AspNetCore.Mvc.Host.Components {
2728
/// />s, instead of needing to add this data to every view model returned by <see cref="TopicController"/>.
2829
/// </para>
2930
/// </remarks>
31+
[ExcludeFromCodeCoverage]
3032
public class PageLevelNavigationViewComponent : PageLevelNavigationViewComponentBase<NavigationTopicViewModel> {
3133

3234
/*==========================================================================================================================

OnTopic.AspNetCore.Mvc.Host/OnTopic.AspNetCore.Mvc.Host.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net5.0</TargetFrameworks>
4+
<TargetFramework>net5.0</TargetFramework>
55
<UserSecretsId>62eb85bf-f802-4afd-8bec-3d344e1cfc79</UserSecretsId>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

OnTopic.AspNetCore.Mvc.Host/Program.cs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
66
using System;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.AspNetCore.Hosting;
89
using Microsoft.Extensions.Hosting;
910

@@ -16,6 +17,7 @@ namespace OnTopic.AspNetCore.Mvc.Host {
1617
/// The <see cref="Program"/> class—and it's <see cref="Program.Main(String[])"/> method—represent the entry point into the
1718
/// ASP.NET Core web application.
1819
/// </summary>
20+
[ExcludeFromCodeCoverage]
1921
public static class Program {
2022

2123
/*==========================================================================================================================

OnTopic.AspNetCore.Mvc.Host/SampleActivator.cs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
66
using System;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.AspNetCore.Mvc;
89
using Microsoft.AspNetCore.Mvc.Controllers;
910
using Microsoft.AspNetCore.Mvc.ViewComponents;
@@ -27,6 +28,7 @@ namespace OnTopic.AspNetCore.Mvc.Host {
2728
/// Responsible for creating instances of factories in response to web requests. Represents the Composition Root for
2829
/// Dependency Injection.
2930
/// </summary>
31+
[ExcludeFromCodeCoverage]
3032
public class SampleActivator : IControllerActivator, IViewComponentActivator {
3133

3234
/*==========================================================================================================================

OnTopic.AspNetCore.Mvc.Host/Startup.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| Client Ignia, LLC
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
6+
using System.Diagnostics.CodeAnalysis;
67
using Microsoft.AspNetCore.Builder;
78
using Microsoft.AspNetCore.Hosting;
89
using Microsoft.AspNetCore.Http;
@@ -20,6 +21,7 @@ namespace OnTopic.AspNetCore.Mvc.Host {
2021
/// <summary>
2122
/// Configures the application and sets up dependencies.
2223
/// </summary>
24+
[ExcludeFromCodeCoverage]
2325
public class Startup {
2426

2527
/*==========================================================================================================================
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
using System.Diagnostics.CodeAnalysis;
7+
using Microsoft.AspNetCore.Mvc;
8+
using Microsoft.AspNetCore.Routing;
9+
using OnTopic.AspNetCore.Mvc.Controllers;
10+
using OnTopic.Mapping;
11+
using OnTopic.Repositories;
12+
13+
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Areas.Area.Controllers {
14+
15+
/*============================================================================================================================
16+
| CLASS: AREA CONTROLLER
17+
\---------------------------------------------------------------------------------------------------------------------------*/
18+
/// <summary>
19+
/// The <see cref="AreaController"/> establishes a controller with the same name as the current area—i.e., <c>Area</c>—as a
20+
/// means of testing the <see cref="ServiceCollectionExtensions.MapImplicitAreaControllerRoute(IEndpointRouteBuilder)"/>
21+
/// extension method, and its underlying <see cref="TopicRouteValueTransformer"/>.
22+
/// </summary>
23+
[Area("Area")]
24+
public class AreaController: TopicController {
25+
26+
/*==========================================================================================================================
27+
| CONSTRUCTOR
28+
\-------------------------------------------------------------------------------------------------------------------------*/
29+
/// <summary>
30+
/// Initializes a new instance of a <see cref="AreaController"/> with necessary dependencies.
31+
/// </summary>
32+
/// <returns>A <see cref="AreaController"/> for loading OnTopic views.</returns>
33+
public AreaController(
34+
ITopicRepository topicRepository,
35+
ITopicMappingService topicMappingService
36+
): base(topicRepository, topicMappingService) {}
37+
38+
/*==========================================================================================================================
39+
| GET: ACCORDION
40+
\-------------------------------------------------------------------------------------------------------------------------*/
41+
/// <summary>
42+
/// Exposes a method which will, by default, be associated with views named <c>Accordion</c>.
43+
/// </summary>
44+
/// <returns>A view associated with the <c>Accordion</c> action.</returns>
45+
public IActionResult Accordion() => TopicView(new(), CurrentTopic!.View);
46+
47+
} //Class
48+
} //Namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
using Microsoft.AspNetCore.Mvc;
7+
8+
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Areas.Area.Controllers {
9+
10+
/*============================================================================================================================
11+
| CLASS: CONTROLLER CONTROLLER
12+
\---------------------------------------------------------------------------------------------------------------------------*/
13+
/// <summary>
14+
/// The <see cref="ControllerController"/> establishes a controller named <c>Controller</c> which will be used to look for
15+
/// views located in e.g. <c>/Views/Controller/{Action}.cshtml</c>. The name <c>Controller</c> helps reinforce that it is
16+
/// acting as a stand-in for an actual <see cref="Controller"/>, as would be implemented in a non-test application.
17+
/// </summary>
18+
[Area("Area")]
19+
public class ControllerController: Controller {
20+
21+
/*==========================================================================================================================
22+
| CONSTRUCTOR
23+
\-------------------------------------------------------------------------------------------------------------------------*/
24+
/// <summary>
25+
/// Initializes a new instance of a <see cref="ControllerController"/>.
26+
/// </summary>
27+
/// <returns>A <see cref="ControllerController"/> for exposing specific actions.</returns>
28+
public ControllerController() {}
29+
30+
/*==========================================================================================================================
31+
| GET: ACTION
32+
\-------------------------------------------------------------------------------------------------------------------------*/
33+
/// <summary>
34+
/// Exposes a method which will, by default, be associated with views named <c>Action</c>.
35+
/// </summary>
36+
/// <returns>A view associated with the <c>Action</c> action.</returns>
37+
public IActionResult Action() => View();
38+
39+
/*==========================================================================================================================
40+
| GET: FALLBACK ACTION
41+
\-------------------------------------------------------------------------------------------------------------------------*/
42+
/// <summary>
43+
/// Exposes a method which will, by default, be associated with views named <c>FallbackAction</c>.
44+
/// </summary>
45+
/// <returns>A view associated with the <c>FallbackAction</c> action.</returns>
46+
public IActionResult FallbackAction() => View();
47+
48+
/*==========================================================================================================================
49+
| GET: SHARED ACTION
50+
\-------------------------------------------------------------------------------------------------------------------------*/
51+
/// <summary>
52+
/// Exposes a method which will, by default, be associated with views named <c>SharedAction</c>.
53+
/// </summary>
54+
/// <returns>A view associated with the <c>SharedAction</c> action.</returns>
55+
public IActionResult SharedAction() => View();
56+
57+
/*==========================================================================================================================
58+
| GET: SHARED FALLBACK ACTION
59+
\-------------------------------------------------------------------------------------------------------------------------*/
60+
/// <summary>
61+
/// Exposes a method which will, by default, be associated with views named <c>SharedFallbackAction</c>.
62+
/// </summary>
63+
/// <returns>A view associated with the <c>SharedFallbackAction</c> action.</returns>
64+
public IActionResult SharedFallbackAction() => View();
65+
66+
/*==========================================================================================================================
67+
| GET: AREA ACTION
68+
\-------------------------------------------------------------------------------------------------------------------------*/
69+
/// <summary>
70+
/// Exposes a method which will, by default, be associated with views named <c>AreaAction</c>.
71+
/// </summary>
72+
/// <returns>A view associated with the <c>AreaAction</c> action.</returns>
73+
public IActionResult AreaAction() => View();
74+
75+
/*==========================================================================================================================
76+
| GET: AREA FALLBACK ACTION
77+
\-------------------------------------------------------------------------------------------------------------------------*/
78+
/// <summary>
79+
/// Exposes a method which will, by default, be associated with views named <c>AreaFallbackAction</c>.
80+
/// </summary>
81+
/// <returns>A view associated with the <c>AreaFallbackAction</c> action.</returns>
82+
public IActionResult AreaFallbackAction() => View();
83+
84+
/*==========================================================================================================================
85+
| GET: AREA SHARED ACTION
86+
\-------------------------------------------------------------------------------------------------------------------------*/
87+
/// <summary>
88+
/// Exposes a method which will, by default, be associated with views named <c>AreaSharedAction</c>.
89+
/// </summary>
90+
/// <returns>A view associated with the <c>AreaSharedAction</c> action.</returns>
91+
public IActionResult AreaSharedAction() => View();
92+
93+
/*==========================================================================================================================
94+
| GET: AREA SHARED FALLBACK ACTION
95+
\-------------------------------------------------------------------------------------------------------------------------*/
96+
/// <summary>
97+
/// Exposes a method which will, by default, be associated with views named <c>AreaSharedFallbackAction</c>.
98+
/// </summary>
99+
/// <returns>A view associated with the <c>AreaSharedFallbackAction</c> action.</returns>
100+
public IActionResult AreaSharedFallbackAction() => View();
101+
102+
103+
} //Class
104+
} //Namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/AreaFallbackAction.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentType/AreaContentTypeView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentType/ContentType.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentType/Shared/AreaContentTypeSharedView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentTypes/AreaContentTypes.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentTypes/AreaContentTypesFallbackView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentTypes/ContentType.AreaContentTypesView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/ContentTypes/Shared/AreaContentTypesSharedView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/Controller/AreaAction.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/Controller/Shared/AreaSharedAction.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/Shared/AreaSharedFallbackAction.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/Areas/Area/Views/Shared/AreaSharedView.cshtml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
7+
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Models {
8+
9+
/*============================================================================================================================
10+
| VIEW MODEL: AREA CONTENT TYPES
11+
\---------------------------------------------------------------------------------------------------------------------------*/
12+
/// <summary>
13+
/// Provides a strongly typed view model for a topic with the <see cref="Topic.ContentType"/> of <c>AreaContentTypes</c>.
14+
/// </summary>
15+
/// <remarks>
16+
/// This is used by the <see cref="TopicViewLocationExpander"/> test to differentiate between content types placed in <c>
17+
/// /Areas/Area/ContentType/</c> and <c>/Area/Area/ContentTypes/</c>. If they used the same <see cref="Topic.ContentType"/>
18+
/// then there would be no way to distinguish between these placements.
19+
/// </remarks>
20+
public class AreaContentTypesViewModel {
21+
22+
} //Class
23+
} //Namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
7+
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Models {
8+
9+
/*============================================================================================================================
10+
| VIEW MODEL: CONTENT TYPE
11+
\---------------------------------------------------------------------------------------------------------------------------*/
12+
/// <summary>
13+
/// Provides a strongly typed view model for a topic with the <see cref="Topic.ContentType"/> of <c>ContentType</c>.
14+
/// </summary>
15+
/// <remarks>
16+
/// The <see cref="Topic.ContentType"/> is set to <c>ContentType</c> for integration tests for the purpose of reinforcing
17+
/// the relationship between the <see cref="Topic.ContentType"/> and views; views will be named e.g. <c>ContentType.cshtml
18+
/// </c> for places where they would typically use the <see cref="Topic.ContentType"/>.
19+
/// </remarks>
20+
public class ContentTypeViewModel {
21+
22+
} //Class
23+
} //Namespace

0 commit comments

Comments
 (0)