title: How to get values from class list inside a class using linq
body: <p>I would like to access class members values inside of list inside of a class. My classes look like this. The <code>SureViewEvents</code> class contains the parent level details for an incoming alarm and the <code>SureViewEventDetails</code> are the detail values for the alarm. I want to loop through class <code>SureViewEvents</code> using LINQ and loop through the details rows if any are populated.</p>
  
  <p>How can I go about doing this?</p>
  
  <pre><code>public class SureViewEvents
  {
      public string EventId { get; set; }
      public string GroupId { get; set; }
      public string DateTimeCreated { get; set; }
      public string GroupTitle { get; set; }
      public string EventTitle { get; set; }
      public string SubscriberId { get; set; }
      public bool Closed { get; set; }
  
      public List&lt;SureViewEventDetails&gt; Details { get; set; }
  }
  
  //EventID|EventRecordID|CreatedDate|EventRecordTypeID|Details|Input1|Input2|EventCode|SubscriberID|EventTitle|SerialNo
  public class SureViewEventDetails
  {
      public string EventId { get; set; }
      public string EventRecordID { get; set; }
      public string CreateDate { get; set; }
      public string EventRecordTypeID { get; set; }
      public string Details { get; set; }
      public string Area { get; set; }
      public string Zone { get; set; }
      public string EventCode { get; set; }
      public string SubscriberID { get; set; }
      public string EventTitle { get; set; }
      public int SerialNo { get; set; }
      public bool Handled { get; set; }
  }
  </code></pre>
  
  <p>I can retrieve the parent level values using the following, but I am not exactly sure how to access the Details that have been populated using this structure. Any advice is appreciated!</p>
  
  <pre><code>var activeEvents = (from sve in m_sureViewEvents 
                      select sve).ToList();
  
  lock (m_driverLock)
  {
      foreach (var activeEvent in activeEvents)
      {
          if (activeEvent.Closed == false)
          {
              m_fepConnector.HandleAlarms();
              DownloadZipArchive(activeEvent.EventId);
              CloseSureViewEvent(activeEvent.EventId);
          }
      }
  }
  </code></pre>