I am getting the following Warning in Visual Studio 2019, after creating a new ASP.NET Core 3 project:
Warning CA1052 Type 'Program' is a static holder type but is neither static nor NotInheritable
public class Program
{
public static void Main(string[] args)
{
// ...
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
// ...
}
vs
public static class Program
{
public static void Main(string[] args)
{
// ...
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
// ...
}
Should I add the static modifier? Why / Why not? Pro's and Cons'?
Edit: This is a ASP.NET Core 3 API