Compare only the date portion not the time of the selectedDateList or courseDateList
So the expected output should be:
5/7/2014 7:00:00 AM
5/7/2014 12:00:00 PM
void Main()
{
var courseDateList = new[]
{
new Dates { Start= Convert.ToDateTime("05/05/2014 07:00:00 AM")},
new Dates { Start= Convert.ToDateTime("05/05/2014 12:00:00 PM")},
new Dates { Start = Convert.ToDateTime("05/06/2014 07:00:00 AM")},
new Dates { Start = Convert.ToDateTime("05/06/2014 12:00:00 PM")},
new Dates { Start= Convert.ToDateTime("05/07/2014 07:00:00 AM")},
new Dates { Start= Convert.ToDateTime("05/07/2014 12:00:00 PM")}
};
var selectedDateList = new[]
{
new Dates { Start= Convert.ToDateTime("05/05/2014 08:00:00 AM")},
new Dates { Start= Convert.ToDateTime("05/06/2014 05:00:00 PM")}
};
selectedDateList.Dump();
courseDateList.Dump();
}
public class Dates
{
public DateTime Start {get; set;}
}

Ramesh MaruthiRank #937 · 2.2K reputationPosted Oct 23, 2014, 5:33 PM EDT
Lawrence Pond149 reputationPosted Oct 23, 2014, 9:08 PM EDT
Lawrence Pond149 reputationPosted Oct 24, 2014, 12:15 PM EDT
var mylookup = selectedDateList.ToLookup(u=>u.Start);
var listdiff = courseDateList.Where(u=>(!mylookup.Contains(u.Start)))