Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Streams and Data Processing Parsing Data Working with DateTime

How is the GameResult.GameDate property storing all of the dates?

The while loop will be sending the date of each line through the TryParse which then feeds the GameResult.GameDate property. But the propery isnt setup as an array or list. Wont the value sent to it be whiped with each run through the while loop?

1 Answer

Tyler B
Tyler B
5,775 Points

You are correct, it will be wiped out each time. This code is still a work in progress, I believe in a later video we will be adding each parsed GameResult value to a list or at the very least printed to screen towards the end of each loop.