title: Model.get returned Null MVC C#
body: <p>Upon my post ActionResult Edit, I am receiving an error. <code>System.Web.Mvc.WebViewPage&lt;TModel&gt;.Model.get returned null</code></p>
  
  <p>My controller:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Edit(editRequestViewModel _editRequestViewModel, int id)
      {
          try
          {
              if (ModelState.IsValid)
              {
                  using (var db = new HelpDeskContext())
                  {
  
                      db.Entry(_editRequestViewModel.userRequest).State = System.Data.Entity.EntityState.Modified;
                      db.SaveChanges();
  
                      return RedirectToAction("Digest",new { id = _editRequestViewModel.userRequest.ID });
                  }
              }
  
              else
                  return View();
          }
          catch (Exception ex)
          {
              return View("Error", new HandleErrorInfo(ex, "Change", "Browse"));
          }
      }
  </code></pre>
  
  <p>My View includes this for the models field to bind: </p>
  
  <pre><code>  @Html.DropDownListFor(model =&gt; model.userRequest.forApplication, Model.Applications, "Select Application", new { @class = "form-control" })
  </code></pre>
  
  <p>My Model has the field as nullable <code>int?</code>:</p>
  
  <pre><code>public int? forApplication { get; set; }
  </code></pre>
  
  <p>It seems to update the other fields in the model with this field just fine on POST. When the request is first created and saved to the DB, it saves fine in that field when its null. It seems to me that nullable should be OK as a value when its posting (Edit ActionResult)?</p>
  
  <p>EDIT: This is my GET Method that populates the View Model which is passed in to the POST.</p>
  
  <pre><code>public ActionResult Edit(int id)
      {
          try
          {
              if (ModelState.IsValid)
              {
                  using (var db = new HelpDeskContext())
                  {
                      var query = (from m in db.Requests
                                   where m.ID == id
                                   select new editRequestViewModel()
                                   {
                                       Applications = (from r in db.Applications
                                                       select new SelectListItem(){
                                                           Text = r.Name,
                                                           Value = r.ID.ToString()
                                                          }).ToList(),
                                       closeReasons = (from r in db.CloseReasons
                                                       select new SelectListItem()
                                                       {
                                                           Text = r.Name,
                                                           Value = r.ID.ToString()
                                                       }).ToList(),
                                       userRequest = m
  
                                   }).FirstOrDefault();
                      return View(query);
                  }
              }
  
              else
                  return View();
          }
          catch (Exception ex)
          {
              return View("Error", new HandleErrorInfo(ex, "Change", "Browse"));
          }
      }
  </code></pre>
  
  <p>And my View has <code>@model HelpDeskSolution.ViewModels.editRequestViewModel</code></p>
  
  <p>EDIT 2: ViewModel and Model</p>
  
  <pre><code>  namespace HelpDeskSolution.Models
   {
    public class Request
     {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity), Key()]
      public int ID { get; set; }
      [Required]
      [StringLength(99, MinimumLength = 3)]
      public string Title { get; set; }
      [StringLength(1000, MinimumLength = 1)]
      [Required]
      public string Description { get; set; }
      [Required]          
      [Display(Name = "Submit Date")]
      public DateTime SubmitDate { get; set; }
      public DateTime? CloseDate { get; set; }
      [Required]
      [StringLength(30)]
      public string Author { get; set; }
      [Required]
      [StringLength(30)]
      public string AuthDept { get; set; }
      [StringLength(30)]
      [Display(Prompt = "Text at top of Epicor Screen...(Optional)")]
      public string Module { get; set; }
      public int Urgency { get; set; }
      [StringLength(30)]
      public string Type { get; set; }
      public int Status { get; set; }
      [StringLength(30)]
      [Display(Name = "Request For")]
      public string RequestFor { get; set; }
      [Required]
      public bool Closed { get; set; }
      [StringLength(30)]
      [Display(Name = "Assign To")]
      public string AssignedTo { get; set; }
      [Display(Name = "Application")]
      public int? forApplication { get; set; }
      public int? closeReason { get; set; }
      public string ClosedBy { get; set; }
      [Display(Name = "ID")]
      public int? duplicateOf { get; set; }
  
      }
      }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code> namespace HelpDeskSolution.ViewModels
      {
  public class editRequestViewModel
  {
      public Request userRequest { get; set; }
      public List&lt;SelectListItem&gt; Applications { get; set; }
      public List&lt;SelectListItem&gt; closeReasons { get; set; }
  
   }
   }
  </code></pre>