Convert List to IEnumerable

前端 未结 6 1392
囚心锁ツ
囚心锁ツ 2020-12-29 01:59

Tricky problem here. I\'m trying to convert items for a list to IEnumerable.

Lists

dynamicTextInDatabase si

6条回答
  •  生来不讨喜
    2020-12-29 02:25

    Maybe try this? (untested)

    ViewBag.AvaiableEnums = dynamicTextEnumsAvaiable.Select(x => 
                                      new SelectListItem() 
                                      {
                                          Text = x.ToString()
                                      });
    

提交回复
热议问题