Skip to content

Commit c9f6b17

Browse files
committed
Merge branch 'improvement/C#10-implicit-usings' into develop
Implemented both C# implicit and global using directives for each projects, thus greatly reducing the number of using directives required on each page. For the global using directives, I generally picked the top three using directives in the project, and particularly those impacted more than 50% of the files. The global using directives have been added to the `AssemblyInfo` class, as that's already used for assembly wide settings. This satisfies Issue #93.
2 parents 5eaa417 + 112c534 commit c9f6b17

251 files changed

Lines changed: 102 additions & 647 deletions

File tree

Some content is hidden

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

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Nullable>enable</Nullable>
66
<AnalysisLevel>latest</AnalysisLevel>
77
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
8+
<ImplicitUsings>enable</ImplicitUsings>
89
</PropertyGroup>
910

1011
<PropertyGroup>

OnTopic.All/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System;
76
using System.Runtime.InteropServices;
87

98
/*==============================================================================================================================

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
| Client Ignia, LLC
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
6-
using System;
76
using System.Diagnostics.CodeAnalysis;
8-
using Microsoft.AspNetCore.Hosting;
9-
using Microsoft.Extensions.Hosting;
107

118
namespace OnTopic.AspNetCore.Mvc.Host {
129

OnTopic.AspNetCore.Mvc.Host/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System;
76
using System.Runtime.InteropServices;
87

98
/*==============================================================================================================================

OnTopic.AspNetCore.Mvc.Host/SampleActivator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
| Client Ignia, LLC
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
6-
using System;
76
using System.Diagnostics.CodeAnalysis;
87
using Microsoft.AspNetCore.Mvc;
98
using Microsoft.AspNetCore.Mvc.Controllers;

OnTopic.AspNetCore.Mvc.Host/Startup.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
66
using System.Diagnostics.CodeAnalysis;
7-
using Microsoft.AspNetCore.Builder;
8-
using Microsoft.AspNetCore.Hosting;
9-
using Microsoft.AspNetCore.Http;
107
using Microsoft.AspNetCore.Mvc.Controllers;
118
using Microsoft.AspNetCore.Mvc.ViewComponents;
12-
using Microsoft.Extensions.Configuration;
13-
using Microsoft.Extensions.DependencyInjection;
14-
using Microsoft.Extensions.Hosting;
159

1610
namespace OnTopic.AspNetCore.Mvc.Host {
1711

OnTopic.AspNetCore.Mvc.IntegrationTests.Host/Areas/Area/Controllers/AreaController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System.Diagnostics.CodeAnalysis;
76
using Microsoft.AspNetCore.Mvc;
8-
using Microsoft.AspNetCore.Routing;
97
using OnTopic.AspNetCore.Mvc.Controllers;
108
using OnTopic.Mapping;
11-
using OnTopic.Repositories;
129

1310
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Areas.Area.Controllers {
1411

OnTopic.AspNetCore.Mvc.IntegrationTests.Host/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
| Client Ignia, LLC
44
| Project Integration Tests Host
55
\=============================================================================================================================*/
6-
using System;
7-
using System.Diagnostics.CodeAnalysis;
8-
using Microsoft.AspNetCore.Hosting;
9-
using Microsoft.Extensions.Hosting;
106

117
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Host {
128

OnTopic.AspNetCore.Mvc.IntegrationTests.Host/Properties/AssemblyInfo.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System;
7-
using System.Diagnostics.CodeAnalysis;
6+
7+
/*==============================================================================================================================
8+
| USING DIRECTIVES (GLOBAL)
9+
\-----------------------------------------------------------------------------------------------------------------------------*/
10+
global using System.Diagnostics.CodeAnalysis;
11+
global using OnTopic.Internal.Diagnostics;
12+
global using OnTopic.Repositories;
13+
14+
/*==============================================================================================================================
15+
| USING DIRECTIVES (LOCAL)
16+
\-----------------------------------------------------------------------------------------------------------------------------*/
817
using System.Runtime.InteropServices;
918

1019
/*==============================================================================================================================

OnTopic.AspNetCore.Mvc.IntegrationTests.Host/Repositories/StubTopicRepository.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System;
7-
using System.Diagnostics.CodeAnalysis;
8-
using OnTopic.Internal.Diagnostics;
96
using OnTopic.Querying;
10-
using OnTopic.Repositories;
117

128
namespace OnTopic.AspNetCore.Mvc.IntegrationTests.Host.Repositories {
139

0 commit comments

Comments
 (0)