title: Setting the default value of a DateTime Property to DateTime.Now inside the System.ComponentModel Default Value Attrbute
body: <p>Does any one know how I can specify the Default value for a DateTime property using the System.ComponentModel DefaultValue Attribute?</p>
  
  <p>for example I try this:</p>
  
  <pre><code>[DefaultValue(typeof(DateTime),DateTime.Now.ToString("yyyy-MM-dd"))]
  public DateTime DateCreated { get; set; }
  </code></pre>
  
  <p>And it expects the value to be a constant expression.</p>
  
  <p>This is in the context of using with ASP.NET Dynamic Data.  I do not want to scaffold the DateCreated column but simply supply the DateTime.Now if it is not present.  I am using the Entity Framework as my Data Layer</p>
  
  <p>Cheers,</p>
  
  <p>Andrew</p>