Say I have a class
Class Record
{
int Id
int StartDate
}
Class DBRecord
{
int Id
DateTime StartDate
DateTime EndDate
}
How could I join these using the linq methods syntax with a condition that the start date is between the dbrecords start and end date? I tried like this but no luck:
this.Records().Join(context.DBRecords,
x=> new { x.Id, x.StartDate},
(x, y) => { x.Id == y.Id, x.StartDate > y.StartDate && x.startDate < x.endDate },
(x,y) => y);
Does anyone know how to do this?