title: How to display Enum as DropDownList in .Net MVC Core
body: <p>I have a class called Options where I'm keeping a bunch of enumerables for different options.  One of these is a Sizes enumerable which is used in my Ball model.  How do I get my Size field for my Ball to display as a dropdown list when creating a new Ball?  I assume I need to make an Editor Template but I don't know what that's supposed to look like.</p>
  
  <p>Here's some example code:</p>
  
  <p><strong>Options.cs</strong></p>
  
  <pre><code>public class Options
  {
      public enum Sizes
      {
          Small,
          Medium,
          Large
      };
  
      public enum Material
      {
          Rubber,
          Plastic,
          Metal
      };
  }
  </code></pre>
  
  <p><strong>Ball.cs</strong></p>
  
  <pre><code>public class Ball
  {
      public string Name { get; set; }
      public Options.Sizes Size { get; set; }
      public Options.Material Material { get; set; }
  }
  </code></pre>
  
  <p><strong>Index.cshtml</strong>
      @model WebApplication.Models.Ball</p>
  
  <pre><code>&lt;form asp-action="Create" asp-controller="Ball"&gt;
      @Html.EditorForModel()
      &lt;input type="submit" value="Submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How do I get EditorForModel to display the enum properties as DropDownLists with the possible values of the Enum?</p>