A Foreach loop automatically produces a Cast to the object you pass. So its sometimes irrelevant to use var inside foreach loop.