C# - AsEnumerable Example

前端 未结 9 1351
耶瑟儿~
耶瑟儿~ 2020-12-20 00:44

What is the exact use of AsEnumerable? Will it change non-enumerable collection to enumerable collection?.Please give me a simple example.

9条回答
  •  一生所求
    2020-12-20 01:06

    After reading the answers, i guess you are still missing a practical example.

    I use this to enable me to use linq on a datatable

    var mySelect = from table in myDataSet.Tables[0].AsEnumerable()
                where table["myColumn"].ToString() == "Some text"
                select table;
    

提交回复
热议问题