title: How to set User on controller property before Action method is accessed in .net core 1.1?
body: <p>Using .net core 1.1 mvc</p>
  
  <p>The objective is to restrict users so that they may only edit themselves, or allow admin to edit user. I need to get the current user and compare that user's id with the user id passed in an an argument (or cookie).</p>
  
  <p>If the user ids don't match, check if the current user is an admin. If so, grab the user of the user id passed in as an argument (or cookie).</p>
  
  <p>We have a controller that receives ApplicationDBContext and UserManager in the constructor via Dependency Injection.</p>
  
  <p>I failed with both of these attempts:
  1) I tried creating an ActionFilter which accessed UserManager through context.Controller.UserManager (a property I set from the controller constructor) but UserManager had an IDisposable error.</p>
  
  <p>2) I tried doing this from the Controller constructor but I need to set the response to 404 if the user is not found and didnt know how to do that from outside of the Action method.</p>