Possible Duplicate:
how to find the index particular items in the list using linq?
I am trying to create a IEnumerable<SelectListItem>
from an array of strings.
string[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
model.month = months
.Select(r => new SelectListItem{Text = r, Value = ???});
Is there a way to access their index within this query?