title: How to save null strings as string.empty when saving changes?
body: <p>Say I have a class like so (details omitted for brevity):</p>
  
  <pre><code>public class Address
  {
      public Address()
      {
          PostalCode = "";
      }
      public string PostalCode { get; set; } 
  }
  </code></pre>
  
  <p>In the mapping, the postal code is marked as required:</p>
  
  <pre><code>public AddressMap()
  {
      this.Property(t =&gt; t.PostalCode)
          .HasColumnName("PostalCode")
          .IsRequired()
          .HasMaxLength(50);
  }
  </code></pre>
  
  <p>In the database it is defined as follows:</p>
  
  <pre><code>CREATE TABLE [dbo].[Address] (
    [PostalCode]   VARCHAR (50)   NOT NULL   DEFAULT ((''))
  );
  </code></pre>
  
  <p>It is initialized in code with a null value for <code>PostalCode</code>:</p>
  
  <pre><code>string pc = null;
  var address = New Address()
  { 
      PostalCode = pc 
  };
  </code></pre>
  
  <p>When I go to add that address to the dbContext, and save changes, I get a <code>DbEntityValidationException</code> because I'm trying to save a null value for a NOT NULL column. </p>
  
  <p>Is there a way to have entity framework or the database not attempt to save a <code>.IsRequired</code> string column as <code>null</code> but instead save it as an empty string?</p>