title: Error on Save: Specified Cast is not Valid
body: <p>I get this error : </p>
  
  <blockquote>
    <p>Value cannot be null</p>
  </blockquote>
  
  <p>I have a viewmodel that references multiple models.
  In view, html helpers are strongly-typed.
  In post action in controller, it receives viewmodel.
  I have multiple cases in <code>POST</code>,
  one case is to save some fields of (one) table referenced in viewmodel,
  other cases to save some fields to (multiple) tables referenced in viewmodel</p>
  
  <p>I added a breakpoint and traced the code, <code>ModelState</code> doesn't return any null values, but when the debugger reaches  <code>var sod_request = new SOD_REQUEST</code> , it doesn't get into the code block and throws the <code>'Value cannot be null'</code> error, pointing to property of another model that I don't want to post data to in the first case. </p>
  
  <p>I handled validation in viewmodel, using foolproof library.
  The properties that I get 'Value cannot be null' on, has <code>RequiredIfFalse</code> validation attribute</p>
  
  <p>I post all <code>not null</code> columns of <code>SOD_REQUEST</code></p>
  
  <p>In the Get method of the same action, I map all attributes of all models</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Initiate(SViewModel vm)
  {
          if (vm.IsDelegated == true) //if user checks Delegate
          {
              try
              {
                  if (ModelState.IsValid)
                  {
  
                      var s_request = new S_REQUEST
                      {
                          REQUEST_ID = TempData["SRequestID"].ToString(),
                          CREATION_DATE = DateTime.Now.Date,
                          INITIATOR_ID = (Int32)TempData["InitiatorID"],
                          SERVICE_TYPE_ID = 1
                      };
  
                      db.S_REQUEST.Add(s_request);
                      db.SaveChanges();
                      return View("Success");
                  }
              }
              catch (Exception ex)
              {
                  ModelState.AddModelError(string.Empty, "Unable to save changes.");
                  Console.Write("check error:    " + ex);
              }
              return View(vm);
          }
  </code></pre>
  
  <p>}</p>
  
  <p>I'm expecting to save to one table only the attributes I mapped</p>
  
  <p>Why it asks for a field in another model to have a value?
  Is it because I'm using strongly-typed views?</p>