title: EntityFramework db.SaveChanges() Only Works When Bool is True
body: <p>An odd thing is happening with EntityFramework.  When I debug db.SaveChanges, I can see that correct data is there, about to be sent to the database.  When the CurrentFirstName field, which is bool, is set to true, the save executes properly and the data ends up in the database.  When CurrentFirstName is set to false, nothing happens, and no data gets to the database.</p>
  
  <p>The entity and stored procedures are mapped correctly.  The entity has a unique primary key.</p>
  
  <p>Is it possible that somehow "false" is not getting translated to "0" correctly for the Insert Stored Procedure?  Any suggestions are appreciated.  Thank you.</p>
  
  <pre><code>    public int PK_FirstNameID { get; set; }
      public string FirstName { get; set; }
      public bool CurrentFirstName { get; set; }
      public int fk_DemographicsID { get; set; }
  
  [HttpPost]
  public PartialViewResult SaveFirstName(DemographicsViewModel model)
  {
      if (ModelState.IsValid)
      {
          try
          {
              int fkid = model.fk_DemographicsID;
              int pkid = model.PK_FirstNameID;
              v_FirstNames fn = new v_FirstNames();
              fn.fk_DemographicsID = model.fk_DemographicsID;
              fn.CurrentFirstName = model.CurrentFirstName;
              fn.FirstName = model.FirstName.ToUpper();
  
              if (pkid &gt; 0)
              {
                  fn.PK_FirstNameID = model.PK_FirstNameID;
                  unitOfWork.DemographicsFirstNamesRepository.Update(fn);
              }
              else
              {
                  unitOfWork.DemographicsFirstNamesRepository.Insert(fn);
              }
              unitOfWork.Save();
              var vm = GetDemographicsViewModel(fkid);
              UpdateDocumentToDemographicsIndex(fn.fk_DemographicsID);
              if (fn.CurrentFirstName == true)
              {
                  UpdateDocumentToAccessionIndex(fn.fk_DemographicsID);
              }
              return PartialView("_FirstNamesDetail", vm);
          }
          catch (DataException ex)
          {
              //Log the error (add a variable name after DataException)
          }
      }
      else
      {
          // error handling
      }
  }
  </code></pre>