title: Set a property to a non-null value of type 'System.Double'
body: <p>How do I resolve this error?</p>
  
  <blockquote>
    <p>The 'CreditsEarned' property on 'Student' could not be set to a 'null'
    value. You must set this property to a non-null value of type
    'System.Double'.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Student : Person
  {
      [DataType(DataType.Date)]
      [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
      [Display(Name = "Enrollment Date")]
      public DateTime EnrollmentDate { get; set; }
  
      // Credits earned
      [Display(Name = "Credits Earned")]
      public double CreditsEarned { get; set; }
  
      // GPA
      [Display(Name = "GPA")]
      [Range(typeof(double), "0.7", "4.0")]
      public double Gpa { get; set; }
  
  
      public virtual ICollection&lt;Enrollment&gt; Enrollments { get; set; }
  }
  </code></pre>