title: How can I insert null value into a nullable enum property using a select list in a view?
body: <p>I have set my enum property as nullable in my model but when I submit my create form I get 'The value 'Select' is not valid for productColor.'</p>
  
  <p>My Model:</p>
  
  <pre><code>  public class product
      {
          public int productId { get; set; }
          public string productName { get; set; }
          public color? productColor { get; set; }
      }
  
      public enum color
      {
          Red, Green, Blue
      }
  </code></pre>
  
  <p>My Create View:</p>
  
  <pre><code>            &lt;div class="form-group"&gt;
                  &lt;label asp-for="productColor" class="control-label"&gt;&lt;/label&gt;
                  &lt;select asp-for="productColor" asp-items="@Html.GetEnumSelectList&lt;color&gt;()" class="form-control"&gt;
                   &lt;option&gt;Select&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;span asp-validation-for="productColor" class="text-danger"&gt;&lt;/span&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; Create([Bind("productId,productName,productColor")] product product)
          {
              if (ModelState.IsValid)
              {
                  _context.Add(product);
                  await _context.SaveChangesAsync();
                  return RedirectToAction(nameof(Index));
              }
              return View(product);
          }
  </code></pre>
  
  <p>Result:</p>
  
  <p>The form appears to post null for the productColor value but the model state is invalid at the controller and the view returns with 'The value 'Select' is not valid for productColor.'</p>