title: Null JSON GET ASP.NET MVC
body: <p>Hi I have two controller methods. I am passing two parameters from the 1st method to the 2nd. The values inserted to database are correct and not NULL. However when there are displayed back on the webpage in the return Json line, they come out as null and im not sure as to why? Here are the controller methods:</p>
  
  <pre><code>  [HttpPost]
      public void CalculateAndSaveToDB(BMICalculation CalculateModel)
      {
          if (ModelState.IsValid)
          {
              CalculateModel.Id = User.Identity.GetUserId();
              CalculateModel.Date = System.DateTime.Now;
              CalculateModel.BMICalc = CalculateModel.CalculateMyBMI(CalculateModel.Weight, CalculateModel.Height);
              CalculateModel.BMIMeaning = CalculateModel.BMIInfo(CalculateModel.BMICalc);
              db.BMICalculations.Add(CalculateModel);
              db.SaveChanges();
          }
  
          CalculateAndSaveToDB(CalculateModel.BMICalc.ToString(), CalculateModel.BMIMeaning.ToString());
      }
  
  
  
      public JsonResult CalculateAndSaveToDB(string o, string t)
      {
          var data = new
          {
              CalculatedBMI = o,
              CalculatedBMIMeaning = t
          };
  
          return Json(data, JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>Update</p>
  
  <p>BMICalculationsModel:</p>
  
  <pre><code> public partial class BMICalculation
  {
      public string Id { get; set; }
      public System.DateTime Date { get; set; }
      public Nullable&lt;double&gt; BMICalc { get; set; }
  
      [Required]
      public double Height { get; set; }
  
      [Required]
      public double Weight { get; set; }
      public int BMICalculationID { get; set; }
      public virtual AspNetUser AspNetUser { get; set; }
      public string BMIMeaning { get; set; }
  
      public double CalculateMyBMI(double KG, double Height)
      {
          return KG / (Height * Height);
      }
  
      public string BMIInfo(double? BMI)
      {
          string BMIInfo = "";
  
          if (BMI &lt;= 18.5)
          {
              BMIInfo = "Underweight";
  
          }
          else if (BMI &gt; 18.5 &amp;&amp; BMI &lt; 25)
          {
              BMIInfo = "Average";
          }
  
          else if (BMI &gt; 25)
          {
              BMIInfo = "Overweight";
          }
  
          return BMIInfo;
      }
  
  }
  </code></pre>