Skip to content

Commit b078c70

Browse files
committed
Marked stateless methods as static
Resolves `CA1822`. A number of methods did not rely on or impact instance data, and thus can be migrated to `static`.
1 parent 007cd27 commit b078c70

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

OnTopic.Editor.AspNetCore.Host/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace OnTopicTest {
1616
/// The <see cref="Program"/> class—and it's <see cref="Program.Main(String[])"/> method—represent the entry point into the
1717
/// ASP.NET Core web application.
1818
/// </summary>
19-
public class Program {
19+
public static class Program {
2020

2121
/*==========================================================================================================================
2222
| METHOD: MAIN
@@ -37,7 +37,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
3737
.CreateDefaultBuilder(args)
3838
.ConfigureWebHostDefaults(webBuilder => {
3939
webBuilder.UseStartup<Startup>();
40-
});
40+
});
4141

4242
} //Class
4343
} //Namespace

OnTopic.Editor.AspNetCore.Host/SampleActivator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public object Create(ViewComponentContext context) {
119119
/*------------------------------------------------------------------------------------------------------------------------
120120
| Configure and return appropriate view component
121121
\-----------------------------------------------------------------------------------------------------------------------*/
122-
if (_standardEditorComposer.IsEditorComponent(type)) {
122+
if (StandardEditorComposer.IsEditorComponent(type)) {
123123
return _standardEditorComposer.ActivateEditorComponent(type, _topicRepository);
124124
}
125125

OnTopic.Editor.AspNetCore.Host/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void ConfigureServices(IServiceCollection services) {
110110
/// Provides configuration the application. This method is called by the runtime to bootstrap the application
111111
/// configuration, including the HTTP pipeline.
112112
/// </summary>
113-
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
113+
public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
114114

115115
/*------------------------------------------------------------------------------------------------------------------------
116116
| Configure: Error Pages

OnTopic.Editor.AspNetCore/Components/FileListViewComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ string htmlFieldPrefix
8989
/// <summary>
9090
/// Retrieves a collection of files in a directory, given the provided <see cref="Path"/>.
9191
/// </summary>
92-
public List<SelectListItem> GetFiles(
92+
public static List<SelectListItem> GetFiles(
9393
string inheritedValue,
9494
FileListAttributeTopicViewModel attribute,
9595
string absolutePath

OnTopic.Editor.AspNetCore/Components/TopicListViewComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public IViewComponentResult Invoke(
151151
>---------------------------------------------------------------------------------------------------------------------------
152152
| Retrieves a collection of topics with optional control call filter properties Scope, AttributeName and AttributeValue.
153153
\-------------------------------------------------------------------------------------------------------------------------*/
154-
public List<QueryResultTopicViewModel> GetTopics(
154+
public static List<QueryResultTopicViewModel> GetTopics(
155155
Topic topic = null,
156156
string attributeKey = null,
157157
string attributeValue = null,

OnTopic.Editor.AspNetCore/StandardEditorComposer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public StandardEditorComposer(ITopicRepository topicRepository, IWebHostEnvironm
6666
/// <summary>
6767
/// Determines whether a given type is capable of being activated by the <see cref="Activate"/> method.
6868
/// </summary>
69-
public bool IsEditorComponent(Type type) =>
69+
public static bool IsEditorComponent(Type type) =>
7070
typeof(StandardEditorComposer).Assembly.Equals(type.Assembly) &&
7171
typeof(ViewComponent).IsAssignableFrom(type);
7272

0 commit comments

Comments
 (0)