Synchronization of two lists I'm looking for a better more efficient way to write some code I have where I"m synchronizing two lists.  Basically, the first list is a list of devices I need to check.  The second list is a list of devices that I have already checked with dates.  I need to synchronize the two lists so I only check devices that are new or out of date based on the date.  I also need to delete any devices that have been removed.

Here is my current code that works fine, it just looks and feels SO clunky.

public IEnumerable&lt;AssetBlob&gt; Synchronize(IEnumerable&lt;AssetBlob&gt; assets, string id) {
      //Get list of devices already checked in lineitemsmap
      List&lt;AssetBlob&gt; items = new List&lt;AssetBlob&gt;();
      IEnumerable&lt;LineItemsMap&gt; lineItems = auditRepo.GetLineItemsMap(id).DeviceResults;
      List&lt;LineItemsMap&gt; deleted = new List&lt;LineItemsMap&gt;();

      //put new items into list
      items.AddRange((from t0 in assets
                      join t1 in lineItems on t0.Id equals t1.BlobId into t1_join
                      from t1 in t1_join.DefaultIfEmpty()
                      where t1 == null
                      select t0).ToList());

      //list of existing items that need updated
      items.AddRange((from t0 in assets
                      join t1 in lineItems on t0.Id equals t1.BlobId
                      where t0.Imported &gt; t1.Created
                      select t0).ToList());

      deleted.AddRange((from t0 in assets
                        join t1 in lineItems on t0.Id equals t1.BlobId
                        where t0.Imported &gt; t1.Created
                        select t1).ToList());

      //Delete items in lineitems that don't exists in assets list
      deleted.AddRange((from t0 in lineItems
                        join t1 in assets on t0.BlobId equals t1.Id into t1_join
                        from t1 in t1_join.DefaultIfEmpty()
                        where t1 == null
                        select t0).ToList());

      if (deleted.Any()) {
        auditRepo.RemoveLineItemMaps(deleted);
      }

      return items;
    }


Any suggestion or improvements would be great.  Thank you.
I haven't tested this due to time constraints, and lack of knowledge of the data, but from my understanding of the problem, this should work.

I have taken the linq join queries, two for the insert, two for the delete and created two IEnumerable.Where clauses, one for insert, one for delete.  The two sets of criteria are combined in an OR statement within the .Where statement.

The one thing I wasn't sure on is if the original list needed to be returned.  That wasn't clear in the original code.  If it does need to be returned, that's an easy change to implement.

EDIT: Changed to do work per Kyles suggestion in comments.

public IEnumerable&lt;AssetBlob&gt; Synchronize(IEnumerable&lt;AssetBlob&gt; assets, string id)
{
    var assetsList = assets.ToList();

    //Get list of devices already checked in lineitemsmap
    IEnumerable&lt;LineItemsMap&gt; lineItems = auditRepo.GetLineItemsMap(id).DeviceResults;

    var items =
        assetsList.Where(
            existingAsset =&gt; 
                // ExisingItems that need updating
                // Any returns true if any of the items in a list meet the criteria
                lineItems.Any(lineItem =&gt; lineItem.BlobId == existingAsset.Id &amp;&amp; existingAsset.Imported &gt; lineItem.Created) ||
                // New items that need inserting.
                // All returns true if all of the items in a list meet the criteria
                // therefore All == !Any
                lineItems.All(lineItem =&gt; lineItem.BlobId == existingAsset.Id)).ToList();


    var deleted =
        lineItems.Where(lineItem =&gt;
                        assetsList.Any(existingAsset =&gt; existingAsset.Imported &gt; lineItem.Created) ||
                        assetsList.All(existingAsset =&gt; existingAsset.Id != lineItem.BlobId)).ToList();

    // If there is a foreach in RemoveLineItemMaps you can probably remove this check.
    // Just cleans up the code a little, and the foreach will take care of this check.
    if (deleted.Any())
    {
        auditRepo.RemoveLineItemMaps(deleted);
    }

    return items;
}