title: How can set a default value constraint with Entity Framework 6 Code First?
body: <p>In a legacy app, most string properties can't be null and need to have a default value of string.empty.</p>
  
  <p>I know it's possible to do this with migrations, but I'm looking for a way to do this using the fluent configuration interface:</p>
  
  <pre><code>    protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Properties&lt;string&gt;().Configure(c =&gt;
          {
              c.HasMaxLength(255);
  
              if (!c.ClrPropertyInfo.IsDefined(typeof (NullableAttribute), false))
              {
                  c.IsRequired();
                  // I want to set a default value (string.empty) here.
              }
      }
  </code></pre>
  
  <p>Is there any way to do this or I'm doomed to initialize all strings in the entity constructors?</p>