title: Accessing additional properties of an Identity user when retrieving data from the database using EF and Linq
body: <p>Lets say I added a couple of additional properties to the default User when using asp.net identity:</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
  }
  </code></pre>
  
  <p>I am aware that in my asp.net MVC controller I can simply do the following to get the current logged in user's name:</p>
  
  <pre><code>User.Identity.Name
  </code></pre>
  
  <p>So when saving to the database I can simply pass User.Identity.Name to my repository along with the object I am saving so the CreatedBy field can be populated.</p>
  
  <p>Now lets say I am retrieving items from the database which have a field of CreatedBy that contains a string of the username, but I want to display Created by : FirstName + LastName in the View.</p>
  
  <p>How do I obtain this extra information? If I was using pure SQL I would do an INNER JOIN on the AspNetUsers table where CreatedBy=Username and simply retrieve the FirstName and LastName in a custom column called CreatedByFullName.</p>
  
  <p>Since I am using Entity Framework now along with the latest version of ASP.NET Identity I am a bit confused at how we are expected to retrieve user information to display in the View of our pages. Is it a matter of doing a join with linq in my repository or simply adding an object to each of my properties called ApplicationUser or is there better ways?</p>