title: What is the difference between Adding ICollection and Simply adding a field to store a key to another table?
body: <p>What is the difference between two sets of Code First Models in the following code. I believe that the first way is practiced generally. But I also find the second method easier because we just have to store a key to the item related to the other table. Are there any advantages of using it in comparison to the second way? I would be happy to clear any confusions in the question. Thanks.</p>
  
  <p>Method 1 :</p>
  
  <pre><code>public class Blog{
  public int BlogId {get;set;}
  public string Name {get;set;}
  public int Category {get;set;}
  public ICollection&lt;Post&gt; Posts{get;set;}
  }
  
  
  public class Post{
  public int PostId{get;set;}
  public string Contents {get;set;}
  public DateTime Date{get;set;}
  public string Author {get;set;}
  public Blog Blog {get;set;}
  }
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>public class Blog{
  public int BlogId {get;set;}
  public string Name {get;set;}
  public int Category {get;set;}
  }
  
  
  public class Post{
  public int PostId{get;set;}
  public string Contents {get;set;}
  public DateTime Date{get;set;}
  public string Author {get;set;}
  public int BlogId {get;set;}
  }
  </code></pre>