title: LINQ adding to list object in loop
body: <p>I have a situation where I need to populate a list object by looping through a loop of objects, check against a condition, and if the condition is met, add the item to my list.  Currently I cannot find an example of the syntax required to add to the list rather than clear it and repopulate it each time the loop iterates to the next item. Can somebody help?</p>
  
  <pre><code>List&lt;ProfileRightsJSON&gt; prf = new List&lt;ProfileRightsJSON&gt;();
  
  try
  {
      for (int i = 0; i &lt; lstProfiles.Count; i++)
      {
          prf = (from p in _database.tblProfileRights
                 where p.fkProfileID ==
                 lstProfiles[i].ProfileID
                 select new ProfileRightsJSON
                 {
                     FunctionID = p.fkFunctionID,
                     UserTypeID = p.fkUserTypeID,
                     RecursiveRights = p.RecursiveRights
                 }).ToList();
      }
  </code></pre>