title: Add one list to another in C#
body: <p>I'm trying to add one list to another . So I have this main list that I'm going to build. I loop through records and built a list and want this list to main list every time I loop. I'm trying to do this in C#.
  I'm using following code. Add() function is not working.I'm getting syntax error.</p>
  
  <pre><code> IList&lt;CgValDetail&gt; cgValDetail = null;
              //Get cgValDetails for each control
              foreach (UiControlScreenMetaData tempUiControls in uiControls)
              {
                  if (tempUiControls.CgValId == null)
                  {
                      continue;
                  }
                  IList&lt;CgValDetail&gt; tempCgValDetail = Retrieval&lt;CgValDetail&gt;.Search(new { CgValId = tempUiControls.CgValId }).ToList();
                  if (!tempCgValDetail.Any())
                  {
                      _foundationService.LogBusinessError(null, new ParameterBuilder("CgValId", tempUiControls.CgValId), "Invalid_CgValId_found");
                      return false;
                  }
                  //Add tempCgValDetail List to main list which is cgValDetail
                  cgValDetail.Add(tempCgValDetail);
  
  
              }
  </code></pre>