M
Merk
Using .NET 3.5 sp1, I have this class:
public class SiteComponentSynchInfo
{
public int SiteComponentID { get; set; }
public DateTime LastUpdatedDT { get; set; }
public string SiteComponentName { get; set; }
}
for which I store several instances, each in one of the following two Lists:
List<SiteComponentSynchInfo> sourceComponents = new
List<SiteComponentSynchInfo>();
List<SiteComponentSynchInfo> destinationComponents = new
List<SiteComponentSynchInfo>();
Given the above two Lists, I would like to have a LINQ query that returns a
List of all SiteComponentSynchInfo instances where the LastUpdatedDT is
newer in the sourceComponents than in the destinationComponents, for the
same SiteComponentID.
I separately need to know which SiteComponentSynchInfo instances exist in
the sourceComponents List but do not exist in the destinationComponents
List - basing this comparison on SiteComponentID (e.g., "which site
components - identified by SiteComponentID - are represented in
sourceComponents but not in destinationComponents?").
Any help here is greatly appreciated. I have been learning the basics of
LINQ and Lambdas, but I'm at a loss on this one.
Thanks!
public class SiteComponentSynchInfo
{
public int SiteComponentID { get; set; }
public DateTime LastUpdatedDT { get; set; }
public string SiteComponentName { get; set; }
}
for which I store several instances, each in one of the following two Lists:
List<SiteComponentSynchInfo> sourceComponents = new
List<SiteComponentSynchInfo>();
List<SiteComponentSynchInfo> destinationComponents = new
List<SiteComponentSynchInfo>();
Given the above two Lists, I would like to have a LINQ query that returns a
List of all SiteComponentSynchInfo instances where the LastUpdatedDT is
newer in the sourceComponents than in the destinationComponents, for the
same SiteComponentID.
I separately need to know which SiteComponentSynchInfo instances exist in
the sourceComponents List but do not exist in the destinationComponents
List - basing this comparison on SiteComponentID (e.g., "which site
components - identified by SiteComponentID - are represented in
sourceComponents but not in destinationComponents?").
Any help here is greatly appreciated. I have been learning the basics of
LINQ and Lambdas, but I'm at a loss on this one.
Thanks!