title: ASP.NET Core 3 - Overriding the default ControllerFactory on custom, how save it call in else cases?
body: <p>How to override the default realization IControllerFactory with a custom factory for custom cases one and keep calling DefaultControllerFactory in normal cases if DefaultControllerFactory has become an inner class in ASP.NET Core 3?</p>
  <pre><code>services.AddSingleton&lt;IControllerFactory, MyCustomControllerFactory&gt;();
  </code></pre>
  <pre><code>// this class for .NET core 2
  public class MyCustomControllerFactory : DefaultControllerFactory
  {
      public override object CreateController(ControllerContext context)
      {
          //custom handling...
  
          //base handling
          return base.CreateController(context);
      }
  
      public override void ReleaseController(ControllerContext context, object controller)
      {
          base.ReleaseController(context, controller);
      }
  }
  </code></pre>
  <p>The DefaultControllerFactory class in .NET 5 is internal and I cannot call its CreateController method to try to get regular controllers registered in the ASP MVC Core 5 environment.</p>
  <pre><code>//this class for .NET core 3 or .NET 5 
      public class MyCustomControllerFactory : IControllerFactory
      {
          public object CreateController(ControllerContext context)
          {
              if(/*is custom case*/) 
              { 
                  /*custom actions*/ 
                  return /*custom IController*/ 
              }
              return /*in this place I want calling base.CreateController(context)*/;
          }
  
          public void ReleaseController(ControllerContext context, object controller)
          {
              var disposable = controller as IDisposable;
              if (disposable != null) { disposable.Dispose(); }
          }
      }
  </code></pre>