title: How can I map an array property to a delimited string db field using EF?
body: <p>I have an object with an array property that I want to persist in the database as a delimited string.  How to I Map that property to the field in the database and vice versus?</p>
  
  <pre><code>public class User() {
    public int Id { get; set; }
    public string[] Roles { get; set; }
  }
  </code></pre>
  
  <p>Incomplete Config Class:</p>
  
  <pre><code>public class UserConfig : EntityTypeConfiguration&lt;User&gt; {
    public UserConfig() {
      this.Property(u =&gt; u.Roles).__???__
      this.Map(u =&gt; u.Properties&lt;string[]&gt;(r =&gt; r.Roles).__???__))
        .HasColumnName("roles");
    }
  }
  </code></pre>
  
  <p>For this example the "Roles" property would  be converted to "roleA,roleB,roleC" when going to the database and then transformed back to an array when read from the database. Is there an on data mapping event somewhere?</p>