Working query filter for co2s
This commit is contained in:
@@ -72,18 +72,21 @@ namespace LeafWeb.WebCms.Utility
|
||||
lid.Site.Longitude <= longitude + range)
|
||||
select li;
|
||||
}
|
||||
|
||||
|
||||
// co2s
|
||||
if (!string.IsNullOrEmpty(query.co2s))
|
||||
{
|
||||
var co2s = double.Parse(query.co2s);
|
||||
var p = double.Parse(query.co2s);
|
||||
|
||||
resultItems =
|
||||
from li in resultItems
|
||||
where co2s >=
|
||||
li.LeafInputData.Max(lid =>
|
||||
lid.Data.Max(d => d.CO2S) -
|
||||
lid.Data.Min(d => d.CO2S)
|
||||
)
|
||||
where
|
||||
// maximum range inside LeafInputFiles
|
||||
li.LeafInputData.Max(lid =>
|
||||
// range of LeafInputData
|
||||
lid.Data.Max(d => d.CO2S)
|
||||
- lid.Data.Min(d => d.CO2S))
|
||||
>= p
|
||||
select li;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user