title: How pass the TempData in ExceptionFilterAttribute in Asp.Net Core
body: <p>I have tried to create the <code>Exception filter</code> for my controller in Asp.Net Core MVC like this:</p>
  
  <pre><code>public class ControllerExceptionFilterAttribute : ExceptionFilterAttribute
  {
      private readonly IHostingEnvironment _hostingEnvironment;
  
      public ControllerExceptionFilterAttribute(
          IHostingEnvironment hostingEnvironment)
      {
          _hostingEnvironment = hostingEnvironment;
      }
  
      public override void OnException(ExceptionContext context)
      {
          //How construct a temp data here which I want to pass to error page?
          var result = new ViewResult
          {
              ViewName = "Error"
          };
  
          context.ExceptionHandled = true; // mark exception as handled
          context.Result = result;
      }
  }
  </code></pre>
  
  <p>I need in <code>OnException</code>method work with <code>TempData</code>- how can I set some exception information to <code>TempData</code>in this place? I have used this TempData to some notification.</p>
  
  <p>There is missing something like this: <code>context.Controller.TempData["notification"]</code> - Controller property was probable removed.</p>