How do linq Last() work?
- by acidzombie24
I dont understand how current can be null and last can be an object while last being a LINQ function. I thought last uses GetEnumerator and keeps going until current == null and returns the object. However as you can see the first GetEnumerator().Current is null and last somehow returns an object.
How do linq Last() work?
var.GetEnumerator().Current
var.Last()