Created
August 10, 2016 14:23
-
-
Save mterwoord/32d3b6ae7e199ea2c401c5b2e5fb8a71 to your computer and use it in GitHub Desktop.
Query.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return (from item in xRitInfoService.All | |
join xApos in xAnalyses.All | |
on new | |
{ | |
item.Bonnummer, | |
AnalyseSource = AnalyseSourceEnum.Apos | |
} equals new | |
{ | |
xApos.Bonnummer, | |
xApos.AnalyseSource | |
} into xAllApos | |
join xLab in xAnalyses.All | |
on new | |
{ | |
item.Bonnummer, | |
AnalyseSource = AnalyseSourceEnum.Lab | |
} equals new | |
{ | |
xLab.Bonnummer, | |
xLab.AnalyseSource | |
} into xAllLab | |
where item.TijdstipIn != null | |
&& item.Afgekeurd == afgekeurd | |
&& item.LeverancierId == mLeverancierId | |
select new RitDetailObj | |
{ | |
Bonnummer = item.Bonnummer, | |
Datum = item.TijdstipIn.Value, | |
AposAs = xAllApos.Average(i => i.Ash), | |
AposNcw = xAllApos.Average(i => i.Ncw), | |
AposDS = xAllApos.Average(i => i.DrogeStof), | |
LabAs = xAllLab.Average(i => i.Ash), | |
LabNcw = xAllLab.Average(i => i.Ncw), | |
LabDS = xAllLab.Average(i => i.DrogeStof), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment