I have following code snippet in c#
List<int> list = new List<int>() { 1, 23, 5, 3, 423, 3 };
var query = list.Cast<double>().Select(d => d);
try
{
foreach (var item in query)
{
Console.WriteLine(item);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
It's compile perfectly,but when i am executing this I am getting exception.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…