title: Access UserProfile from a controller MVC 4
body: <p>New to all this:
  I have a model for Character that has a UserProfile property, so that a character can be assiciated with a UserProfile entry. This would make UserProfile a foreign key for a Character.</p>
  
  <p>Character Model:</p>
  
  <pre><code>public class Character
  {
      public int ID { get; set; }
      public virtual UserProfile user { get; set; }
      public string name { get; set; }
  ...
  }
  </code></pre>
  
  <p>(I made the UserProfile property virtual because of another post, not sure if this should stay)</p>
  
  <p>When creating a new character I want to set the user property of that character to the object of the current web-user making the request. For example here is the process a user would take to make a character:
  Login/Create User account with site
  Click 'Create Character'</p>
  
  <pre><code>[HttpPost]
  public ActionResult Create(Character character)
  {
      if (ModelState.IsValid)
      {
          character.user = ???
          db.Characters.Add(character);
          db.SaveChanges();
          ...
  }
  </code></pre>
  
  <p><strong>Problem is I do not know how to access the UserProfile table from my controller.</strong> Typically to access a table I create an object of my dbContext but the UserProfile table is using the default MVC 4 context while all the other objects of my app are using a different dbContext.</p>
  
  <p>I'm guessing there are a few solutions for me, none of which I can figure out how to do:</p>
  
  <ol>
  <li>Should I set up my application so all tables use 1 dbContext? If so, how?</li>
  <li>Is there some way to create an object of the default dbContext that UserProfile is already using?</li>
  </ol>
  
  <p>Sorry in advance if any of my terminology is off or if I left out vital information. I'll provide more as needed. Thanks</p>