title: How to tell ASP.NET Core view exists from controller?
body: <p>Sometimes a controller needs to check if a view exists so that it can take some action if it doesn't?</p>
  
  <p>I've seen similar questions like this one <a href="https://stackoverflow.com/questions/946990/does-a-view-exist-in-asp-net-mvc">Does a view exist in ASP.NET MVC?</a> for prior versions of asp.net mvc but such approaches don't work for ASP.NET Core.  I have been unable to locate any documentation on how to do it with ASP.NET Core from inside the controller.  </p>
  
  <p>Given the following:</p>
  
  <pre><code>string viewLoc= "~/views/some-folder/some-file.cshtml";
  </code></pre>
  
  <p>How can the controller determine if the view exists?</p>