title: Custom ValueConvertor to display enum value
body: <p>I have a BasisOfFee property that is mapped to an BasisOfFeeType enum.</p>
  <p>How can I ensure that when I query the web api endpoint, it returns a &quot;Display&quot; data annotation of the enum value instead of the enum value itself?</p>
  <p>I checked the different <a href="https://docs.microsoft.com/en-us/ef/core/modeling/value-conversions" rel="nofollow noreferrer">Microsoft provided valueType convertors</a> and I could not find a HashSet to value type convertor.</p>
  <pre><code>public class ProductSvc
  {
    public BasisOfFeeType BasisOfFee{get;set}
  }
  using System.ComponentModel.DataAnnotations;
  public enum BasisOfFeeType
  {
    [Display(Name=&quot;Male Person&quot;)]
    Male:1,
    [Display(Name=&quot;Female Person&quot;)]
    Female:2
  }
  public class ProductSvcEntityConfiguration: IEntityTypeConfiguration&lt;ProductSvc&gt;
  {
    public void Configure(EntityTypeBuilder&lt;ProductSvc&gt; builder)
    {
      builder.Property().HasColumnName(&quot;basis_of_fee&quot;).HasConversion(new 
      EnumToNumberConvertor&lt;BasisOfFeeType, byte&gt;());
    }
  }
  </code></pre>