Once you remove the final close bracket to get it to compile...
Enum.GetValues returns an array of the values in the enum: so if teh enum was:
public enum Gender
{
Male = 1,
Female = 2,
Bieber = 666,
}
Then it would return an array of three integer values: 1, 2, 666
These it then casts to an IEnumerable of Gender class items, and uses Select to convert each of those into a new SelectListItem instance and finally results in an IEnumerable of those.
It's the equivalent of this code:
List<SelectListItem> list = new List<SelectListItem>();
foreach (int i in Enum.GetValues(typeof(Gender)))
{
Gender g = (Gender)i;
SelectListItem item = new SelectListItem();
item.Text = g.ToString();
item.Value = g.ToString();
list.Add(item);
}
IEnumerable<SelectListItem> returnValue = list;