title: How to access Extension method from view context in MVC Core 2
body: <p>I want access <strong>ViewContext</strong> on view because I have created extension method and using that extension I want to access Base Controller on View. </p>
  
  <p>Refer to the code below</p>
  
  <pre><code>public static class ViewContextExtension
  {       
      public static BaseController BaseController(this ControllerContext view)
      {
          BaseController objBaseController = null;
          if (view != null)
              objBaseController = view.Controller as BaseController;
          return objBaseController;
      }
  }
  </code></pre>
  
  <p>I want to use same code in MVC Core 2 but I am not able access it on view side.</p>
  
  <p>Previously I was using it in MVC 5.2.3 E.g.</p>
  
  <pre><code>!ViewContext.BaseController().IsMobileDevice
  </code></pre>