title: The null value cannot be assigned to a member with type Int32 but strings work
body: <p>I have a class that maps to a table using LINQ but not ORM. It works with all the strings in the class and displays them in the view. However, if I add any <code>Int32</code>, <code>Int16</code> or <code>DateTime</code> I get the error </p>
  
  <blockquote>
    <p>The null value cannot be assigned to a member with type.</p>
  </blockquote>
  
  <p>With the code below:</p>
  
  <pre><code>[Table(Name = "RegisterBoo")]
  public class RegistrationBoo
  {
      [Column] public string BooNum { get; set; }
      //[Column(CanBeNull = true)] public Int32 ServiceStatusId { get; set; }
  </code></pre>
  
  <p>If I uncomment the commented out line the code fails in the controller at:</p>
  
  <pre><code>        return View(BooRepository.Registrations.ToList());
  </code></pre>
  
  <p>with:</p>
  
  <blockquote>
    <p>The null value cannot be assigned to a member with type Int32</p>
  </blockquote>
  
  <p>Most of the columns in the database can be NULL and this is something that I cannot change because I am not DBA. Why does <code>CanBeNull</code> not work? How do I solve this error? I also tried using <code>Nullable&lt;&gt;</code> and using some of the ideas outlined in the forums.</p>