title: How to solve field 'XXX' is never assigned to, and will always have its default value?
body: <pre><code>public class Product : BaseEntity
  {     
      public string ProductTitle { get; set; }
      public string ProductDescription { get; set; }
  
      
      private readonly DateTime _dateTime;
      public DateTime ProductExpirationDate
      {
          get { return _dateTime; }
          set
          {
              if (DateTime.Now &gt;= _dateTime)
              {
                  Console.WriteLine(&quot;Product past the expiration date!&quot;);
                  
              } 
          }
      }
  }
  </code></pre>
  <p>/***************/</p>
  <pre><code>class Program
  {
      static void Main(string[] args)
      {         
          Product product = new Product
          {
              Id = 1,
              ProductTitle = &quot;Milk&quot;,
              ProductDescription = &quot;Description of milk&quot;,
              ProductExpirationDate = Convert.ToDateTime(&quot;08/09/2011 04:05:02&quot;)
          };
  
          Console.WriteLine(product.Id);       
          Console.WriteLine(product.ProductTitle);
          Console.WriteLine(product.ProductDescription);
          Console.WriteLine(product.AddDate);
          Console.WriteLine(product.ProductExpirationDate);
      }
  }
  </code></pre>
  <p>Except 'ProductExpirationDate' every thing is fine. I'm practicing on OOP. But the value that i given in Program.cs is not send to Product.cs. It says &quot;Field 'Product.dateTime' is never assigned to, and will always have its default value&quot;</p>