title: What is the Entity Framework Core attribute equivalent to modelBuilder's HasDefaultValueSql?
body: <p>I want to use annotations for setting the default value for my properties in Entity Framework Core. The issue is that the database is not setting the default values so the value is not being passed down to the database layer. </p>
  
  <p>I want to do something similar to <code>modelBuilder</code>'s <code>HasDefaultValueSql</code>:</p>
  
  <pre><code>[DefaultValue("400")]
  public int LengthInMeters {get; set;}
  </code></pre>
  
  <p>How do you convert the below code to attributes?</p>
  
  <pre><code>modelBuilder.Entity&lt;Patient&gt;().Property(c =&gt; c.LengthInMeters).HasDefaultValueSql("400");
  </code></pre>
  
  <p>Using default values by themselves doesn't work. I want to use attributes alone without having to mess with the migrations.</p>
  
  <p>Problems: I've tried other methods with EF but Entity Framework Core doesn't have some items. Such as <code>modelBuilder.Conventions</code> nor <code>AttributeToColumnAnnotationConvention</code> nor <code>CSharpMigrationCodeGenerator</code> nor <code>modelBuilder.Properties()</code></p>