title: Nullable object must have a value datetime
body: <p>database</p>
  
  <pre><code>EmbarkDate       [] allowNulls checked
  DisembarkDate    [] allowNulls checked
  
    update [dbo].[t_CrewContract] set EmbarkDate= null where cc_ID='AEDAEC31-6108-CE8F-97DF-114FD87A6257'
    update [dbo].[t_CrewContract] set DisembarkDate= null where cc_ID='AEDAEC31-6108-CE8F-97DF-114FD87A6257' 
  </code></pre>
  
  <p>c#</p>
  
  <pre><code>     public DateTime? EmbarkDate { get; set; }
       public DateTime? DisembarkDate{ get; set; }
  
  ContractItems.Add(new ContractItem
                      {
     EmbarkDate = item.cc_EmbarkDate.HasValue != null ? item.cc_EmbarkDate.Value : item.cc_EmbarkDate = null,
  
     DisembarkDate = item.cc_DisembarkDate.HasValue != null ? item.cc_DisembarkDate.Value     : item.cc_DisembarkDate = null,
  
  });
  
  if(activeContract.EmbarkDate == null)
  {
    //...codes
  }
  </code></pre>
  
  <p>error : Nullable object must have a value
  What's the problem
  thank you</p>