title: 'No suitable constructor found for entity type' when doing EF Core migration (SmartEnum)
body: <p>I am attempting to run <code>update-database</code> to migrate some changes that I made to my db.</p>
  
  <p>It all goes well until I get the following error:</p>
  
  <blockquote>
    <p>No suitable constructor found for entity type 'ReportType'. The
    following constructors had parameters that could not be bound to
    properties of the entity type: cannot bind 'id', 'name' in
    'ReportType(string id, string name)'.</p>
  </blockquote>
  
  <p>Here is the code for ReportType.cs:</p>
  
  <pre><code>public class ReportType : SmartEnum&lt;ReportType, string&gt;
      {
          public static readonly ReportType ReportType1 = new ReportType("Blah", "Blah");
          public static readonly ReportType ReportType2 = new ReportType("Blah", "Blah");
          public static readonly ReportType ReportType3 = new ReportType("Blah", "Blah");
  
          // required for EF, but breaking for SmartEnum
          // private ReportType() {}
  
          private ReportType(string id, string name) : base(name, id)
          {
  
          }
      }
  </code></pre>
  
  <p>As you can see in the commented section of that code, having a parameterless constructor would normally fix this issue for EF Core, but SmartEnum doesn't have a parameterless constructor base.</p>
  
  <p>There was a commit to the SmartEnum library on Arpil 27th, 2018 that added a parameterless constructor so that this issue wouldn't exist, but that change was removed in a later commit and I am unsure how to proceed without it. </p>
  
  <p>That commit can be found here: <a href="https://github.com/ardalis/SmartEnum/commit/870012d406609a4a8889fdde2139750dc618d6a9" rel="noreferrer">https://github.com/ardalis/SmartEnum/commit/870012d406609a4a8889fdde2139750dc618d6a9</a></p>
  
  <p>And was removed in this commit:
  <a href="https://github.com/ardalis/SmartEnum/commit/1c9bf3ede229fcb561330719cd13af67dcf92ad7" rel="noreferrer">https://github.com/ardalis/SmartEnum/commit/1c9bf3ede229fcb561330719cd13af67dcf92ad7</a></p>
  
  <p>Any help is greatly appreciated!</p>
  
  <p>EDIT:</p>
  
  <p>Here's my solution to this issue as per Ivan's comments:</p>
  
  <pre><code>            modelBuilder.Entity&lt;Report&gt;()
                  .Property(p =&gt; p.ReportType)
                  .HasConversion(
                      p =&gt; p.Value,
                      p =&gt;ReportType.FromValue(p));
  </code></pre>