title: How To Extend the Controller Class With My Custom Methods
body: <p>I want to get my methods easily from extended controller class and to add some method to the Controller class to use in all other controllers like this:</p>
  
  <p><strong>Extension</strong></p>
  
  <pre><code>public string GetString()
  {
      return "iamanexample";
  }
  </code></pre>
  
  <p><strong>AuthenticationController</strong></p>
  
  <pre><code>public class AuthenticationController : Controller
  {
     public IActionResult Index()
     {
         string getMyStr = GetString();
         return View();
     }
  }
  </code></pre>
  
  <p>Do I have to create a custom class which inherited by the Controller class and adds my methods in it, and then uses my custom controller class? Or is there any other solution to make it?</p>