Welcome to the Treehouse Community
Looking to learn something new?
Kyaw Tun Sein2,291 Points
At 8:33, the tutor doesn't explain why run time error if Documents is not instantiated to a new List<Document>. So, why?
Thanks for the comment Steven. Here is the video link: https://teamtreehouse.com/library/text-analytics-api-part-1
Steven Parker215,954 Points
Without initialization, you'd be trying to access the .Add() method of null.
This would of course produce an error. Unless established in the constructor, the properties of a newly created object (such as sentimentRequest here) are all null.
So to be able to use the .Add() method, the Document must first be initialized to an empty list.