title: Entity Framework: Setting a Foreign Key Property
body: <p>We have a table that looks roughly like this:</p>
  
  <pre><code>CREATE TABLE Lockers 
  {
    UserID int NOT NULL PRIMARY KEY (foreign key),
    LockerStyleID int (foreign key),
    NameplateID int (foreign key)
  }
  </code></pre>
  
  <p>All of the keys relate to other tables, but because of the way the application is distributed, it's easier for us to pass along IDs as parameters.  So we'd like to do this:</p>
  
  <pre><code>Locker l = new Locker { 
    UserID = userID, 
    LockerStyleID = lockerStyleID, 
    NameplateID = nameplateID 
  };
  entities.AddLocker(l);
  </code></pre>
  
  <p>We could do it in LINQ-to-SQL, but not EF?</p>