I need to join two tables and get the data from one of the table using linq.
The join works fine but it returns IEnumerable <$IEnumerable><$Ojbect> and I need IEnumerable<$Object>
Here is the code:
(
from med in meds
join pres in prescriptions
on med.Code equals pres.Code into latstPrescrptions
let allPrescriptions = latstPrescrptions.Where(
pres => pres.PatientId == patientId
&& (pres.PrescriptionEndDate > DateTime.Now)
|| pres.PrescriptionEndDate == null
)
select allPrescriptions
);
Thanks