title: What's the difference when I create Code First relation setting only a collection
body: <p>I am using <code>Entity Framework 5</code> with Code First. I update my model(entities) while I'm writing the business logic which leads to some problems. Since now when I wanted to create <code>1 : N</code> relationship I was using this approach:</p>
  
  <pre><code>Entity-1
  {
    public int Entity-1ID { get; set; }
    public virtual ICollection&lt;Entity-N&gt; Entity-Ns { get; set; }
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Entity-N
  {
    public int Entity-NID { get; set; }
    public int Entity-1ID { get; set; }
    public virtual Entity-1 Entity-1 { get; set; }
  }
  </code></pre>
  
  <p>bur recently I faced the problem with the need of null Foreign Keys (I needed to add more relations to some entities) and since I am already using GenericRepository where all types are value types (no nullables) and also have some code written based on that I decided that it's too late to change all this. </p>
  
  <p>Since I already have Foreign Key for some entity and I need to relate that entity with a new one I have faced a problem. </p>
  
  <p>My solution is - when I have a new entity I only add collection from the existing entity to the new one (or vice-verca). What bothers me is - what kind of problems this may cause if I use it.</p>
  
  <p>Right now I have entity <code>Page</code> where</p>
  
  <pre><code>Page
  {
    public virtual ICollection&lt;SomeEntity&gt; SomeEntities { get; set; }
  }
  </code></pre>
  
  <p>and as expected in <code>SomeEntity</code> I don't have a <code>FK</code> for <code>Page</code> but when I look at the <code>Microsoft SQL Management Studio</code> I see that the <code>SomeEntities</code> table has a column called <code>Page_PageID</code>.</p>
  
  <p>Can someone explain me what exactly happens when I make a relation like this. Why even though I have this column <code>Page_PageID</code> which practically acts as <code>FK</code> I can't use it from my code and why if I explicitly define <code>public int PageID { get; set; }</code> in <code>SomeEntitiy</code> and I try to change <code>int</code> to <code>int?</code> I get all kinds of errors for trying to use null but with this auto-created column <code>Page_PageID</code> there's no problem to have records with null values for it.</p>