title: Is there another way for this abstract class to derive from this generic type? Error CS0310
body: <p>I have these pieces of code:</p>
  
  <pre><code>// The Singleton.cs file.
  public abstract class Singleton&lt;T&gt; where T : class, new()
  {
      private static T _instance;
  
      public static T Instance =&gt; _instance ?? (_instance = new T());
  }
  // The ScriptEvent.cs file.
  public abstract class ScriptEvent : Singleton&lt;ScriptEvent&gt;
  {
      public abstract void RaiseEvent(params object[] raiseParameters);
  
      public abstract void Subscribe(Delegate toSubscribe);
  
      public abstract void Unsubscribe(Delegate toUnsubscribe);
  
      public abstract Delegate[] GetSubscribers();
  }
  </code></pre>
  
  <p>I would like for ScriptEvent to derive from Singleton since ScriptEvent has to be a singleton. This however gives me this error:</p>
  
  <pre><code>Error   CS0310  'ScriptEvent' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'Singleton&lt;T&gt;
  </code></pre>
  
  <p>So far the only solution I can see is to directly implement the Singleton functionality directly into ScriptEvent, and while this would work, does feel quite unclean/unnecessary to me.</p>
  
  <p>Is there a way I could solve this issue? I would prefer to keep ScriptEvent as Abstract, although as I am writing this I have realized I could also deabstract it and use virtual methods instead. That might however confuse future users of this code, since they might try to instantiate a ScriptEvent, which isn´t intended (hence the singletonization :P and abstraction). I also suppose that one other solution would be to make ScriptEvent generic, and have derived classes provide their own type, similar to how the Singleton works, but I would consider this quite unoptimal, since I would prefer to avoid as much possible confusion for derivers.</p>
  
  <p>EDIT: I have found a (temporary?) solution to my problem.
  I use the "deabstract" method. I made the class into a regular class, replaced all abstract methods with almost identical virtual ones, but added an empty static constructor to prevent instancing!
  I would still however like an answer, as I am not quite satisfied with this solution.</p>