title: Entity Framework and Guid
body: <p>let's say I have this code :</p>
  
  <pre><code>var foo = new Foo { Id = Guid.NewGuid(); }
  
  var id = foo.Id; // have access to the id here
  
  context.Add(foo);
  context.SaveChanges();
  </code></pre>
  
  <p>How does <code>Guid.NewGuid()</code> avoid collision with a Guid already on my Database? What if the generated guid already exists on the database ? I don't get it.</p>
  
  <p>Using a autoincrement id is obvious, but I won't know the id until I save to the database which make sense. How does guid does it to work 'different' ?</p>