title: How to get second related value from List in ViewData MVC?
body: <p>I have customer list which is having all details like
  customerId,firstname,lastname</p>
  
  <pre><code>GetAllCustomer() method code
        var customer = from d in dbContext.Customers
                                             select d;
                  return customer.ToList();
  </code></pre>
  
  <p>In Index.cs
  I have bind firstname to dropdown list</p>
  
  <pre><code>var customerData =GetAllCustomer();
  
  ViewBag.customerfirstname = new SelectList(customerData.Select(t=&gt;t.firstname));
  </code></pre>
  
  <p>index.cshtml</p>
  
  <pre><code>@using (Html.BeginForm("Index", "Home", FormMethod.Get))
  {
          &lt;p&gt;
              customer name : @Html.DropDownList("customerfirstname", "All")
              &lt;input type="submit" value="Filter" /&gt; 
  
          &lt;/p&gt;
  }
  </code></pre>
  
  <blockquote>
    <p>when I select any firstname from dropdown and click on submit
     I also want its customerId too.</p>
  </blockquote>
  
  <p>How can I do it so?</p>