Code: Select all
using (var db = new DataContext())
{
List<ExtendedJournal>eventList0 = (from j in db.Journal
join jp in db.JournalPerson on j.IdJournal equals jp.IdJournal
join p in db.Person on jp.IdPerson equals p.IdPerson
where idsPerson.Contains(jp.IdPerson) &
(j.DatetimeEnd.Equals(null) | DateTime.Now - j.DatetimeStart < date)
orderby j.DatetimeStart descending
orderby j.DatetimeEnd descending
select new ExtendedJournal {Journal = j, Person = p}).ToList();
...
return eventList0;
}
I have no idea I'm doing something wrong or is this a bug in linq.