title: How to add record into the database using MVC
body: <p>I am trying to add a record into a database but its showing me a error: <code>An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code</code> i get this error when i run my program, it does not even open my view in web-browser</p>
  
  <p>This is my model:</p>
  
  <pre><code>public class MovieModel
  {
      public int ID { set; get; }
      public string FirstName { set; get; }
      public string SecondName { set; get; }
      public DateTime DOB { set; get; }
      public string Type{ set; get; }
  }
  </code></pre>
  
  <p>This is my controller: </p>
  
  <pre><code>namespace Movie.Controllers
  {
      public class MoviesController : Controller
      {
          private ApplicationDbContext db = new ApplicationDbContext();
  
          //
          // GET: /Movies/
          public ActionResult AddUsers(MovieModel model)
          {
              if (ModelState.IsValid)
              {
                  db.Movies.Add(model);
                  db.SaveChanges();
              }
              return View(model);
          }
      }
  }
  </code></pre>
  
  <p><strong>Second Question</strong> when up-grading my database <code>upgrade-database</code> how do i specify a forgone key? is this have to be done via microsoft sql server management?</p>