title: Entity Framework database-first + uniqueidentity result no new guid id
body: <p>I cannot generate a new guid id for my primary key. Getting same error every time when I try to create an another user as it wont generate a new guid id.  </p>
  
  <blockquote>
    <p>Violation of PRIMARY KEY constraint 'PK_User'. Cannot insert duplicate
    key in object 'dbo.User'. The duplicate key value is
    (00000000-0000-0000-0000-000000000000). The statement has been
    terminated.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>public partial class User
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public System.Guid Id { get; set; }
      public string UserName { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string Email { get; set; }
  }
  </code></pre>
  
  <p>My UserController code</p>
  
  <pre><code>[HttpGet]
  public ActionResult Create() {
      return View();
  }
  
  [HttpPost]
  public ActionResult Create(User user) {
          if (ModelState.IsValid) {
              db.Users.Add(user);
              db.SaveChanges();
  
              return RedirectToAction("Index");
          }
  
          return View(user);
  }
  </code></pre>
  
  <p>How do I automatically generate new guids?</p>