Getting second element in ICollection C# in LINQ

Edit
While writing a unit test, I want to grab the 2nd element from an ICollection to do my assertion. My vocabulary for ICollection only contain, First(), Take(). I tried to see if that is enough to implement what I need. After some trial and error, I still could not find what I need. Thus I do some google and found "ElementAt()" method. Indeed, I found there is a whole list of useful method in the link below!





Enumerable Methods (System.Linq)
Getting second element in ICollection C# in LINQ Getting second element in ICollection C# in LINQ Reviewed by DF on 8:29:00 PM Rating: 5
©DF. Powered by Blogger.