Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9e0e4d6
Resolve CS8600: Converting null to non-nullable
JeremyCaney Jun 23, 2026
4699df3
Resolve CS8602: Dereference of a null reference
JeremyCaney Jun 23, 2026
744ce53
Resolve CS8602: Dereference of a null reference
JeremyCaney Jun 23, 2026
2989976
Resolve CS8602: Public getter unavailable
JeremyCaney Jun 23, 2026
c0e5516
Resolve CS8602: Acknowledge there will be topics
JeremyCaney Jun 23, 2026
d1d0c61
Resolve CS8603: Possible null reference return
JeremyCaney Jun 23, 2026
caa6bc3
Resolve CS8604: Possible null parameter argument
JeremyCaney Jun 23, 2026
171b7c1
Resolve CS8604: Throw if no parameter name
JeremyCaney Jun 23, 2026
085c670
Resolve CS8622: Parameter nullability mismatch
JeremyCaney Jun 23, 2026
6a41f51
Resolve CA1851: Possible multiple enumerations
JeremyCaney Jun 23, 2026
d9865f2
Resolve CA1859: Change return type for performance
JeremyCaney Jun 23, 2026
c488b43
Resolve CA1861: Prevent repeat array allocations
JeremyCaney Jun 23, 2026
c257254
Resolve CA1865: Use `string.StartsWith(char)`
JeremyCaney Jun 23, 2026
b23e51c
Suppress CA1024: Use properties where appropriate
JeremyCaney Jun 23, 2026
4684460
Resolve SYSLIB0051: Formatter-based serialization
JeremyCaney Jun 23, 2026
771e424
Resolve CA1822: Member can be marked as static
JeremyCaney Jun 23, 2026
854d383
Resolve CA1019: Remove property setter from Type
JeremyCaney Jun 23, 2026
c7ad458
Upgrade GitVersion from 5.11.1 to 6.7.0
JeremyCaney Jun 23, 2026
921927d
Implement source-generated regex
JeremyCaney Jun 23, 2026
92d5b8b
Fixed flakey test with timestamp evaluation
JeremyCaney Jun 23, 2026
0ace7e1
Suppress warnings on unused, obsolete events
JeremyCaney Jun 23, 2026
0f8d134
Resolve SYSLIB0051: Formatter-based serialization
JeremyCaney Jun 23, 2026
1e53ad1
Repress CS0618: This is intentional until removed
JeremyCaney Jun 23, 2026
db08594
Resolve CS8601: Possible null reference assignment
JeremyCaney Jun 23, 2026
a30a70b
Resolve CS8602: Possible null dereference
JeremyCaney Jun 23, 2026
129c2b6
Prefer newer collection expressions
JeremyCaney Jun 23, 2026
6a8f392
Fixed encoding issues within comments
JeremyCaney Jun 23, 2026
ffaf6f5
Resolve CS8604: Unnecessary null-forgiveness
JeremyCaney Jun 23, 2026
9daad5e
Resolve CS8604: Resolve duplicate `GetValue()`
JeremyCaney Jun 23, 2026
a22c5fe
Resolve CS8604: Filter out null references
JeremyCaney Jun 23, 2026
4e1c623
Resolve CS8604: Centralize variable for null check
JeremyCaney Jun 23, 2026
2862b16
Resolve CS8604: Acknowledge null `actionName`
JeremyCaney Jun 23, 2026
7eb25ba
Suppress CA1024: Use properties where appropriate
JeremyCaney Jun 23, 2026
08f5141
Suppress CA1032: Intentional missing constructor
JeremyCaney Jun 23, 2026
6a4df66
Suppress CA1034: Do not nest types
JeremyCaney Jun 23, 2026
4c1484e
Suppress CA1044: Write-only properties
JeremyCaney Jun 23, 2026
eb47536
Suppress CA1711: Collection suffix
JeremyCaney Jun 23, 2026
2021d9e
Resolve CA1822: Member can be static
JeremyCaney Jun 23, 2026
7983ac1
Resolve CA1851: Multiple enumerations (cont.)
JeremyCaney Jun 23, 2026
8a1c5fe
Resolve CA1854: Prefer `TryGetValue()`
JeremyCaney Jun 23, 2026
94e7bf2
Resolve CA1859: Change type to `List<XElement>`
JeremyCaney Jun 23, 2026
322e99b
Resolve CA1860: Prefer 'Count == 0' over `Any()`
JeremyCaney Jun 23, 2026
ecf7c7e
Sidestep CA1861: Prefer readonly over const arrays
JeremyCaney Jun 23, 2026
818fbdc
Resolve CA1865: Prefer `char` overload over array
JeremyCaney Jun 23, 2026
8529f50
Suppress CA2227: Read-only collection properties
JeremyCaney Jun 23, 2026
4100760
Suppress CA1515: Internal testing fixtures
JeremyCaney Jun 23, 2026
1a1f580
Fixed encoding issues within comments (cont.)
JeremyCaney Jun 23, 2026
760494f
Resolved xUnit1030: Remove `ConfigureAwait(false)`
JeremyCaney Jun 23, 2026
d6eb2a4
Adopt C# 14's `field` keyword
JeremyCaney Jun 23, 2026
7ba2392
Suppress CA1859: Concrete type for performance
JeremyCaney Jun 23, 2026
4031d2a
Resolve xUnit1012: Nullability mismatch
JeremyCaney Jun 23, 2026
5b7bb95
Resolve CA2263: Prefer the generic overload
JeremyCaney Jun 23, 2026
2f81522
Resolve CA1822: Member can be static (cont.)
JeremyCaney Jun 23, 2026
21d474f
Resolve CA1865: Prefer character overload
JeremyCaney Jun 23, 2026
5a0d6b6
Resolve xUnit2017: Use `Contains()` for collection
JeremyCaney Jun 23, 2026
7c618de
Resolve CA2263: Prefer the generic overload (cont)
JeremyCaney Jun 23, 2026
3708347
Implemented `[CallerArgumentExpression]`
JeremyCaney Jun 23, 2026
bbd3cdb
Resolve xUnit1051: User xUnit `CancellationToken`
JeremyCaney Jun 23, 2026
7a9feee
Suppress CA1515: Internal testing fixtures (cont.)
JeremyCaney Jun 23, 2026
50c681b
Suppress CA1024: Use properties where appropriate
JeremyCaney Jun 24, 2026
9957ed6
Normalize `Version` to UTC
JeremyCaney Jun 30, 2026
aeadead
Seal `internal` classes that aren't derived
JeremyCaney Jun 30, 2026
43d3e41
Prefer pattern-matched `switch` statements
JeremyCaney Jun 30, 2026
97d4978
Return value from `Contract.Requires<T>` overload
JeremyCaney Jun 30, 2026
e7d7451
Fixed bug with `DateTime` null check
JeremyCaney Jun 30, 2026
6010756
Prefer primary constructors, where appropriate
JeremyCaney Jun 30, 2026
ecb7d56
Fixed broken test case with `Requires()`
JeremyCaney Jun 30, 2026
412d822
Prefer file-scoped namespaces
JeremyCaney Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ indent_size = 2

[*.sql]
indent_style = tab
indent_size = 16
indent_size = 16

[*.cs]
csharp_style_namespace_declarations = file_scoped:warning

# CA1859: Use concrete types when possible for improved performance
# Interface usage in this codebase is deliberate—e.g., to express a shared
# dependency's contract, or to scope a test to the interface under test—so
# this suggestion is not adopted.
dotnet_diagnostic.CA1859.severity = none
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="GitVersion.MsBuild" Version="5.11.1" />
<PackageVersion Include="GitVersion.MsBuild" Version="6.7.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.28" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.301" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.5" />
Expand Down
11 changes: 10 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
mode: ContinuousDelivery
branches:
master:
regex: ^master$|^main$
mode: ManualDeployment
release:
mode: ContinuousDelivery
feature:
mode: ContinuousDelivery
hotfix:
mode: ContinuousDelivery
unknown:
mode: ContinuousDelivery
ignore:
sha: []
61 changes: 30 additions & 31 deletions OnTopic.AspNetCore.Mvc.Host/Components/MenuViewComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,39 @@
using OnTopic.Repositories;
using OnTopic.ViewModels;

namespace OnTopic.AspNetCore.Mvc.Host.Components {
namespace OnTopic.AspNetCore.Mvc.Host.Components;

/*==============================================================================================================================
| CLASS: MENU VIEW COMPONENT
\-----------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Defines a <see cref="ViewComponent"/> which provides access to a menu of <see cref="NavigationTopicViewModel"/>
/// instances.
/// </summary>
/// <remarks>
/// <para>
/// As a best practice, global data required by the layout view are requested independent of the current page. This
/// allows each layout element to be provided with its own layout data, in the form of <see
/// cref="NavigationViewModel{T}"/>s, instead of needing to add this data to every view model returned by <see
/// cref="TopicController"/>.
/// </para>
/// </remarks>
[ExcludeFromCodeCoverage]
public class MenuViewComponent : MenuViewComponentBase<NavigationTopicViewModel> {

/*============================================================================================================================
| CLASS: MENU VIEW COMPONENT
| CONSTRUCTOR
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Defines a <see cref="ViewComponent"/> which provides access to a menu of <see cref="NavigationTopicViewModel"/>
/// instances.
/// Initializes a new instance of a <see cref="MenuViewComponentBase{T}"/> with necessary dependencies.
/// </summary>
/// <remarks>
/// <para>
/// As a best practice, global data required by the layout view are requested independent of the current page. This
/// allows each layout element to be provided with its own layout data, in the form of <see
/// cref="NavigationViewModel{T}"/>s, instead of needing to add this data to every view model returned by <see
/// cref="TopicController"/>.
/// </para>
/// </remarks>
[ExcludeFromCodeCoverage]
public class MenuViewComponent : MenuViewComponentBase<NavigationTopicViewModel> {

/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Initializes a new instance of a <see cref="MenuViewComponentBase{T}"/> with necessary dependencies.
/// </summary>
/// <returns>A topic controller for loading OnTopic views.</returns>
public MenuViewComponent(
ITopicRepository topicRepository,
IHierarchicalTopicMappingService<NavigationTopicViewModel> hierarchicalTopicMappingService
) : base(
topicRepository,
hierarchicalTopicMappingService
) {}
/// <returns>A topic controller for loading OnTopic views.</returns>
public MenuViewComponent(
ITopicRepository topicRepository,
IHierarchicalTopicMappingService<NavigationTopicViewModel> hierarchicalTopicMappingService
) : base(
topicRepository,
hierarchicalTopicMappingService
) {}

} //Class
} //Namespace
} //Class
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,38 @@
using OnTopic.Repositories;
using OnTopic.ViewModels;

namespace OnTopic.AspNetCore.Mvc.Host.Components {
namespace OnTopic.AspNetCore.Mvc.Host.Components;

/*==============================================================================================================================
| CLASS: PAGE-LEVEL NAVIGATION VIEW COMPONENT
\-----------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Defines a <see cref="ViewComponent"/> which provides access to a menu of <see cref="NavigationTopicViewModel"/>
/// instances representing the nearest page-level navigation.
/// </summary>
/// <remarks>
/// <para>
/// As a best practice, global data required by the layout view are requested independent of the current page. This
/// allows each layout element to be provided with its own layout data, in the form of <see cref="NavigationViewModel{T}"
/// />s, instead of needing to add this data to every view model returned by <see cref="TopicController"/>.
/// </para>
/// </remarks>
[ExcludeFromCodeCoverage]
public class PageLevelNavigationViewComponent : PageLevelNavigationViewComponentBase<NavigationTopicViewModel> {

/*============================================================================================================================
| CLASS: PAGE-LEVEL NAVIGATION VIEW COMPONENT
| CONSTRUCTOR
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Defines a <see cref="ViewComponent"/> which provides access to a menu of <see cref="NavigationTopicViewModel"/>
/// instances representing the nearest page-level navigation.
/// Initializes a new instance of a <see cref="MenuViewComponentBase{T}"/> with necessary dependencies.
/// </summary>
/// <remarks>
/// <para>
/// As a best practice, global data required by the layout view are requested independent of the current page. This
/// allows each layout element to be provided with its own layout data, in the form of <see cref="NavigationViewModel{T}"
/// />s, instead of needing to add this data to every view model returned by <see cref="TopicController"/>.
/// </para>
/// </remarks>
[ExcludeFromCodeCoverage]
public class PageLevelNavigationViewComponent : PageLevelNavigationViewComponentBase<NavigationTopicViewModel> {

/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Initializes a new instance of a <see cref="MenuViewComponentBase{T}"/> with necessary dependencies.
/// </summary>
/// <returns>A topic controller for loading OnTopic views.</returns>
public PageLevelNavigationViewComponent(
ITopicRepository topicRepository,
IHierarchicalTopicMappingService<NavigationTopicViewModel> hierarchicalTopicMappingService
) : base(
topicRepository,
hierarchicalTopicMappingService
) {}
/// <returns>A topic controller for loading OnTopic views.</returns>
public PageLevelNavigationViewComponent(
ITopicRepository topicRepository,
IHierarchicalTopicMappingService<NavigationTopicViewModel> hierarchicalTopicMappingService
) : base(
topicRepository,
hierarchicalTopicMappingService
) {}

} //Class
} //Namespace
} //Class
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>62eb85bf-f802-4afd-8bec-3d344e1cfc79</UserSecretsId>
<IsPackable>false</IsPackable>
<NoWarn>CA1515</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions OnTopic.AspNetCore.Mvc.Host/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using OnTopic.AspNetCore.Mvc.Host;
using OnTopic.Internal.Diagnostics;

#pragma warning disable CA1812 // Avoid uninstantiated internal classes
#pragma warning disable CA1812 // Avoid uninstantiated internal classes

/*==============================================================================================================================
| CONFIGURE SERVICES
Expand All @@ -21,7 +21,7 @@
\-----------------------------------------------------------------------------------------------------------------------------*/
builder.Services.Configure<CookiePolicyOptions>(options => {
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});

Expand Down Expand Up @@ -95,4 +95,4 @@
\-----------------------------------------------------------------------------------------------------------------------------*/
app.Run();

#pragma warning restore CA1812 // Avoid uninstantiated internal classes
#pragma warning restore CA1812 // Avoid uninstantiated internal classes
Loading