C#

C#

Made by DeepSource

abstract classes cannot contain public constructors CS-R1096

Anti-pattern
Major
Autofix

Since an abstract class cannot be instantiated, it is pointless to have a public constructor. Consider narrowing down the access modifier to either protected or private.

Bad Practice

abstract class C
{
    public C()
    {
    }
}

Recommended

abstract class C
{
    protected C()
    {
    }
}