using System.Linq;
using System.Web.Mvc;

namespace LeafWeb.WebCms.Models
{
	public class SelectListViewModel
	{
		public SelectList ListItems { get; set; }
		public string Selected { get; set; }

		public SelectListItem SelectedItem
		{
			get { return ListItems.FirstOrDefault(li => li.Value == Selected); }
		}

		public override string ToString()
		{
			return Selected;
		}
	}
}