Now
IList<string> listOfStrings = (new string[] { "bob","mary"});
We cannot reform
listOfStrings.ToList().ForEach(i => i.DoSome(i)));
We need to redo the concrete implementation of the interface
List<string> listOfStrings = ((new string[] { "bob","mary"}).ToLIst();
Then we can do a for each
listOfStrings.ForEach(i => i.DoSome(i)));
This is because the foreach statement does not work with the IList interface and why is this?
source share