In ASP.NET MVC, you can use a collection of SelectListItems to help build an HTML . Just watch out for the HTML helper overloads. The question is – what is the prettiest code that can change a list of Products into a collection of SelectListItems? Tonight, you’ll be the judge in this first contest of charm, grace, and readability. Contestant #1 hails from the System.Web.Mvc namespace. It likes pina coladas and string literals, but is turned off by tattoos that look like programming symbols. Let me introduce the SelectList class: var products = GetProducts();
var selectItems = new SelectList(products, "ID",...