I have the following query:
List<Meeting> meetings =
(from m in crdb.tl_cr_Meetings
join p in crdb.tl_cr_Participants on m.MeetingID equals p.MeetingID
where p.TimeOut == null
select new Meeting
{
MeetingID = m.MeetingID,
MeetingName = m.MeetingName,
HostUserName = m.HostUsername,
BlueJeansMeetingID = m.tl_cr_BlueJeansAccount.MeetingID,
StartTime = m.StartTime,
Participants = (from pa in crdb.tl_cr_Participants
where pa.MeetingID == m.MeetingID
select pa.tl_cr_BlueJeansAccount.DisplayName).ToList()
}).Distinct().ToList();
And I want it to bring back a list of unique meetings. For some reason it brings back an entry for every participant, even though the data is identical:
Am I missing a grouping somewhere?
EDIT
The meeting class is currently very basic:
public class Meeting
{
public int MeetingID { get; set; }
public string MeetingName { get; set; }
public string HostUserName { get; set; }
public DateTime StartTime { get; set; }
public List<string> Participants { get; set; }
public string BlueJeansMeetingID { get; set; }
}