Answer: The reason is we are not instantiating the list of documents.We need to initialize the collection. Below is the way to initialize the the collection inside the constructor and to get the program work
public class Lead
{
public Lead()
{
Documents = new List<Document>();
}
public string LeadFirstName { get; set; }
public List<Document> Documents { get; private set; }
}
Asked In: Many Interviews |
Alert Moderator