Count()
is an extension method on IEnumerable<T>
, declared in System.Linq.Enumerable
- so you're actually calling:
Enumerable.Count(_tables);
... so _tables
is a method argument, and it makes sense for the exception to tell you that. You're not actually dereferencing the _tables
variable when you call Count()
, whereas you are when you call GetType
.