By Defualt, when you create a new ASP.Net MVC app, the RouteConfig is not a static class but the only method it has "RegisterRoutes" is a static method.
When I analyse my code using SonarQube, the tool suggests the following for RouteConfig.cs
Add a "protected" constructor or the "static" keyword to the class declaration
So, should I make the class static?
Whether the class is static or not will not change the behavior of the application. So if it is for making your code analysis tool happy, go ahead, make it static.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With