title: Associating data with a user
body: <p>For my first ASP.NET MVC 3 application, I'm using the <code>aspnet_Users</code> and <code>aspnet_Roles</code> tables to provide authentication for my users and for a few roles.  That seems to work pretty well.  Additionally, I want to make associations between the logged-in user and rows in various tables.  </p>
  
  <p>As a concrete example, I've got a <code>Recipes</code> table which has columns specific to recipes (name, dates, attributes) as well as a <code>UserID</code> column.  That <code>UserID</code> column is currently a foreign key to a <code>Users</code> table in my IceCreamDB (NOT the <code>aspnet_Users</code> table in the aspnetdb) which contains various domain-specific information about users of the system.  So, it's easy enough to create a query that retrieves all of Matt's recipes, by creating a user in my Users table named Matt who has some integer UserId and then use that UserId during Creates and Updates to the <code>Recipes</code> table.  Great.</p>
  
  <p>To tie the logged-in user "itsmatt" (from the aspnet_Users table) to my IceCreamDB's Users table UserId for Matt, I have a Guid column in IceCreamDB Users table which is filled in with the aspnet_Users Id (its a Guid) for the login.  </p>
  
  <p>IceCreamDB's Users table:</p>
  
  <pre><code> UserId     1               // primary key used as FK for other tables 
   UserName   Matt
   Phone      555-1212
   Department Product Development
   Building   2-A
   Office     221
   UserGuid   7fc75a6c-7e32-43f3-be8c-be0122bf54cb // Guid from aspnetdb User table
  </code></pre>
  
  <p>And this works OK - as part of the user registration process, I create an aspnet_User, set up whatever roles (e.g., "Administrators", "Owners", "Production") are appropriate, and then create a user entry in the IceCreamDB Users table, copying the Guid into the new row.  This lets me log into the website and see my recipes or my orders.</p>
  
  <p>But I feel I've home-brewed this solution and there's likely a better, different approach to doing this. I'd like some guidance on this. </p>