title: How to query an array of objects in C#
body: <p>I want to query an array of objects "sortedData", where each object has two values (ItemId, Sort), for a specific ItemId and set the 'Sort' value. Like this below but this isn't the correct linq syntax.</p>
  
  <pre><code>var sortedData = db.Fetch&lt;object&gt;("SELECT ItemId, Sort FROM CollectionItems WHERE CollectionId = @0", collectionId);
  dataWithSort = db.Fetch&lt;OrganizationForExportWithSort&gt;(TpShared.DAL.StoredProcedures.GetOrganizationsForTargetListUI(clientId, organizationIdList));
  foreach(OrganizationForExportWithSort export in dataWithSort)
              {
                      export.Sort = sortedData.Select("Sort").Where(sortedData.ItemId == export.Id);
              } 
  </code></pre>