title: how to map nullable column to a non nullable variable?
body: <p>if we have a table that already has a fields marked as allow null (in sql server), and for some reason i want to map these fields to a class in c# code but keep my variables as non nullable (discrete values), and if i is null in db give this variable its default value in c#.</p>
  
  <p>for example:</p>
  
  <pre><code>Table Employee (
    ID int Not NULL,
    Name nvarchar(256) NOT NULL,
    Age int NULL)
  </code></pre>
  
  <p>Now i want this table to be mapped to this class</p>
  
  <pre><code>class Employee {
     public int ID {get; set;} 
     public string Name {get; set;}
     public int Age {get; set;} 
  }
  </code></pre>
  
  <p>i have no problem to use either linq to sql, or nhibernate, either will do the job.</p>
  
  <p>can anyone give me a solution for this</p>
  
  <p>Ah, BTW, if the Age field in db is null I want the Age variable to take the default value of int (for example 0)</p>