I have a linq to sql query
var items = from p in ctx.bam_Zending_AllInstances
join q in ctx.bam_Zending_CompletedRelationships
on p.ActivityID equals q.ActivityID
join r in ctx.bam_Prestatie_AllInstances
on q.ReferenceData equals r.ActivityID
where q.ReferenceType == "Activity" &&
p.Zendingnummer == zenderNr
orderby r.PrestatieCode
select new Data.BAMPrestatieInstance
{
Aanvaard = r.PrestatieAanvaard,
Contactnummer = r.ContactNr,
Foutmelding = r.Foutmelding,
Identificatie = r.Identificatie,
Ontvangen = r.PrestatieZendingOntvangen,
Uitvoerdatum = r.Uitvoerdatum,
ZendingsNr = p.Zendingnummer,
PrestatieCode = r.PrestatieCode
};
This returns a list of classes of multiple "r.PrestatieCode"s. "Uitvoerdatum" is a date however, and I need to only have the latest date for each r.PrestatieCode. How should I go about with this? Because I know how to do this in sql, but I can't seem to find the way to do it in linq.
Need this a lot atm actually,
any help is usefull,
thanks a bunch!
Gr