title: ASP.net identity: How to get current IdentityUser (ApplicationUser)? Where is UserManager.FindById?
body: <p>I started with the default template for ASP.net in VS2013. I want to get the current user object. This should be possible without directly accessing the database.</p>
  
  <p>In the documentation, this looks very easy: <a href="http://blogs.msdn.com/b/webdev/archive/2013/10/16/customizing-profile-information-in-asp-net-identity-in-vs-2013-templates.aspx" rel="noreferrer">http://blogs.msdn.com/b/webdev/archive/2013/10/16/customizing-profile-information-in-asp-net-identity-in-vs-2013-templates.aspx</a></p>
  
  <p>So it should be </p>
  
  <pre><code>var currentUser = manager.FindById(User.Identity.GetUserId()); 
  </code></pre>
  
  <p>But FindById is missing! Since several hours, I have been trying to use FindByIdAsync instead. But I think I get a dead lock. </p>
  
  <pre><code>public class UserManager : UserManager&lt;IdentityUser&gt;
  {
      public UserManager()
          : base(new UserStore&lt;IdentityUser&gt;(new ApplicationDbContext()))
      {
      }
  
      public async System.Threading.Tasks.Task&lt;IdentityUser&gt; GetCurrentUser()
      {
          var user = await FindByIdAsync(HttpContext.Current.User.Identity.Name);
          return user;
      }
  }
  </code></pre>
  
  <p>The calling propery:</p>
  
  <pre><code>private IdentityUser_CurrentUser;
  protected IdentityUser CurrentUser
  {
      get
      {
          if (_CurrentUser == null)
          {                   
              var manager = new UserManager();
              var result = manager.GetCurrentUser();
              //-- STOPS HERE!!
              _CurrentUser = result.Result;
          }
          return _CurrentUser;
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated! Either to show me where FindById is gone or how to make my code work. Or is there another way to load the IdentityUser? </p>
  
  <p><strong>ADDED</strong></p>
  
  <p>In the user manager, <code>FindById</code> is not found, but <code>this.FindById</code> is found. I will add the screenshots. This is not a proper solution because I do not understand, why this is happening, or can someone explain this behaviour? I attach 2 screens with intellisense open. I also want to mention, that it is not a problem of intellisense - the code does not compile if I do not add <code>this.</code></p>
  
  <p>Intellisense entering "Fi":</p>
  
  <p><img src="https://i.stack.imgur.com/TIflv.jpg" alt="Intellisense open with Fi">.</p>
  
  <p>Intellisense entering "this.Fi":</p>
  
  <p><img src="https://i.stack.imgur.com/MxxoL.jpg" alt="Intellisense open with this.Fi"></p>
  
  <p>This way, at least I am not stuck any more.</p>