title: How to pass value from an enum selectlist to controller to filter results
body: <p>I've created a drop down menu on a web page that needs to filter results loaded from a database by their country. I've created and populated the list from an enum class, which I will provide in the code below. I'm stuck on figuring out how to pass the value selected to the controller so I can perform the filter? </p>
  
  <pre><code>//View
  @model List&lt;Merchandise&gt;
  
  @{
      ViewData["Title"] = "Variant Summary";
  }
  
  &lt;header&gt;
      &lt;nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"&gt;
          &lt;div class="container"&gt;
              &lt;h2&gt;Variant Summary&lt;/h2&gt;
              @Html.DropDownList("Countries", new SelectList(Enum.GetValues(typeof(Countries))))             
          &lt;/div&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  
  //Model
   public class Merchandise
      {
          public string Id { get; set; }
          //g.PlanSeqId, g.ItemId, g.ItemDescription, g.OrderQuantity, g.OrderSldTdy, g.PlannedMinutesQty, g.ActualMinutesQty
          public int PlanSeqId { get; set; }
          public int ItemId { get; set; }
          public string ItemDescription { get; set; }
          public int OrderQuantity { get; set; }
          public int OrderSldTdy { get; set; }
          public int PlannedMinutesQty { get; set; }
          public int ActualMinutesQty { get; set; }
          public Countries Countries { get; set; }
      }
  
      public enum Countries
      {
          USA, EUR, JPN
      }
  
  //Controller
  public IActionResult Merchandise()
          {            
              Countries selCountry = Countries.USA;
              switch (selCountry)
              {
                  case Countries.USA:
                      var bucket = _bucketProvider.GetBucket("MerchUSA");
                      var n1ql = @"SELECT META(g).id, g.PlanSeqId, g.ItemId, g.ItemDescription, g.OrderQuantity, g.OrderSldTdy, g.PlannedMinutesQty, g.ActualMinutesQty
                                  FROM `MerchUSA` g
                                  WHERE g.CompanyId = 0;
                                  LIMIT = 20;";
                      var query = QueryRequest.Create(n1ql);
                      var results = bucket.Query&lt;Merchandise&gt;(query);
                      return View(results.Rows);
                  case Countries.EUR:
                      var bucket2 = _bucketProvider.GetBucket("MerchEUR");
                      var n1ql2 = @"SELECT META(g).id, g.PlanSeqId, g.ItemId, g.ItemDescription, g.OrderQuantity, g.OrderSldTdy, g.PlannedMinutesQty, g.ActualMinutesQty
                                  FROM `MerchEUR` g
                                  WHERE g.CompanyId = 1;
                                  LIMIT = 20;";
                      var query2 = QueryRequest.Create(n1ql2);
                      var results2 = bucket2.Query&lt;Merchandise&gt;(query2);
                      return View(results2.Rows);
                  case Countries.JPN:
                      var bucket3 = _bucketProvider.GetBucket("MerchJPN");
                      var n1ql3 = @"SELECT META(g).id, g.PlanSeqId, g.ItemId, g.ItemDescription, g.OrderQuantity, g.OrderSldTdy, g.PlannedMinutesQty, g.ActualMinutesQty
                                  FROM `MerchJPN` g
                                  WHERE g.CompanyId = 2;
                                  LIMIT = 20;";
                      var query3 = QueryRequest.Create(n1ql3);
                      var results3 = bucket3.Query&lt;Merchandise&gt;(query3);
                      return View(results3.Rows);
              }
              return View();
          }
  </code></pre>
  
  <p>Right now I'm just seeing the dropdown with the countries, but no value is being passed to the controller to filter the results.</p>