namespace PlayWithCollection { class Program { static void Main(string[] args) { ListModel = new List () { "1", "2", "3" }; foreach (var item in Model.Select((value, i) => new { i, value })) { Console.WriteLine("Collection Object Values : " + item.value); Console.WriteLine("Collection Index : " + item.i); } } }
No comments:
Post a Comment