Convert from List into IEnumerable format

后端 未结 6 1085
情歌与酒
情歌与酒 2020-12-07 23:47
IEnumerable _Book_IE
List _Book_List

How shall I do in order to convert _Book_List into IEnumerable

6条回答
  •  Happy的楠姐
    2020-12-08 00:31

    IEnumerable _Book_IE;
    List _Book_List;
    

    If it's the generic variant:

    _Book_IE = _Book_List;
    

    If you want to convert to the non-generic one:

    IEnumerable ie = (IEnumerable)_Book_List;
    

提交回复
热议问题