I feel like the first thing I would have done is pass around the reader itself.
LineParser.ParseLine(TextReader reader) { try { if(ValidateSection("MNO", reader)){ int elementId = ParseIntSection(reader); int vehicleId = ParseIntSection(reader); int term = ParseIntSection(reader); int mileage = ParseIntSection(reader); decimal value = ParseDecimalSection(reader); var valueHolder = new ValueHolder(elementId, vehicleId, term, mileage, value); } } finally { ReadToNewline(reader); } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I feel like the first thing I would have done is pass around the reader itself.