namespace EzPL8.Models
{
public class MyEggs
{
public Dictionary<int, string> Egg { get; set; }
public MyEggs()
{
Egg = new Dictionary<int, string>()
{
{ 0, "No Preference"},
{ 1, "I hate eggs"},
{ 2, "Over Easy"},
{ 3, "Sunny Side Up"},
{ 4, "Scrambled"},
{ 5, "Hard Boiled"},
{ 6, "Eggs Benedict"}
};
}
}
}
The Controller:
public ActionResult Index()
{
var model = new EzPL8.Models.MyEggs();
return View(model);
}
In the View convert it to a list for display
@Html.DropDownListFor( m => m.Egg.Keys, new SelectList( Model.Egg, "Key", "Value") )