I have bound a drop down list to the enum of days of week like this:
private void BindDayOfWeek()
this.ddlDayOfWeek.DataSource = GetWeekDays();
private List<DayOfWeek> GetWeekDays()
Now I want to read the int value of the selected week day (from dropdown list) which was in enum DayOfWeek i.e. if I select "Sunday" from dropdown, I should be able to pick the int value of "Sunday" in the enum DaysOfWeek (NOT ddlDayOfWeek.selectedValue OR SelectedIndex)
How can I do that without a switch and if (Which I think can be one way)?