我试图这样做:
IEnumerable<object> ids = new List<string>() { "0001", "0002", "0003" };
它发挥了巨大作用。
But when 我试图这样做:
IEnumerable<object> intIds = new List<System.Int32>() { 1, 2, 3 };
Visual Studio tells me: Cannot implicitly convert type System.Collections.Generic.List to System.Collections.Generic.IEnumerable . An explicit conversion exists (are you missing a cast?)
为什么如此?