Skip to content

Commit 112c534

Browse files
committed
Introduced global using directives for the OnTopic.ViewModels library
The three most commonly referenced namespaces in this project are: - `System.ComponentModel.DataAnnotations` - `System.Diagnostics.CodeAnalysis` - `OnTopic.Models` These only impact around five files each, but that still represents a majority of files with `using` directives. (As these are lightweight POCO models, most don't even have `using` directives.) These have been added as `global using` directives (in the `AssemblyInfo`) and removed from the individual files.
1 parent 15070aa commit 112c534

8 files changed

Lines changed: 11 additions & 13 deletions

File tree

OnTopic.ViewModels/BindingModels/AssociatedTopicBindingModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System.ComponentModel.DataAnnotations;
76
using OnTopic.Mapping.Reverse;
8-
using OnTopic.Models;
97

108
namespace OnTopic.ViewModels.BindingModels {
119

OnTopic.ViewModels/BindingModels/RelatedTopicBindingModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System.Diagnostics.CodeAnalysis;
76
using OnTopic.Mapping.Reverse;
8-
using OnTopic.Models;
97

108
namespace OnTopic.ViewModels.BindingModels {
119

OnTopic.ViewModels/NavigationTopicViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
| Project Website
55
\=============================================================================================================================*/
66
using System.Collections.ObjectModel;
7-
using System.ComponentModel.DataAnnotations;
8-
using OnTopic.Models;
97

108
namespace OnTopic.ViewModels {
119

OnTopic.ViewModels/Properties/AssemblyInfo.cs

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

819
/*==============================================================================================================================

OnTopic.ViewModels/TopicViewModel.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 Topics Library
55
\=============================================================================================================================*/
6-
using System.ComponentModel.DataAnnotations;
7-
using System.Diagnostics.CodeAnalysis;
86
using OnTopic.Mapping.Annotations;
9-
using OnTopic.Models;
107

118
namespace OnTopic.ViewModels {
129

OnTopic.ViewModels/_collections/TopicViewModelCollection{TItem}.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66
using System.Collections.ObjectModel;
7-
using System.Diagnostics.CodeAnalysis;
87
using OnTopic.Internal.Diagnostics;
9-
using OnTopic.Models;
108

119
namespace OnTopic.ViewModels {
1210

OnTopic.ViewModels/_contentTypes/PageTopicViewModel.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 OnTopic.Models;
76

87
namespace OnTopic.ViewModels {
98

OnTopic.ViewModels/_contentTypes/VideoTopicViewModel.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.ComponentModel.DataAnnotations;
76

87
namespace OnTopic.ViewModels {
98

0 commit comments

Comments
 (0)