public override IEnumerable <IRow> Search(IQueryFilter filter, bool recycling) { var filterHelper = FilterHelper.Create(_schema, filter.WhereClause); ISpatialFilter spatialFilter = filter as ISpatialFilter; bool hasSpatialFilter = spatialFilter?.Geometry != null; return(AllRows.Where(r => filterHelper.Check(r) && (!hasSpatialFilter || CheckSpatial(r, spatialFilter)))); }
public WithCubeResult() { lazyGroup1 = new Lazy <Dictionary <G1, A> >(() => CalculateTotals((r) => r.Group1, (r) => null)); lazyGrandTotal = new Lazy <A>(() => AllRows.Where(r => r.Group1 == null).FirstOrDefault().Aggregate); }
protected Dictionary <T, A> CalculateTotals <T>(Func <G, WithCubeGroup <T> > desiredGroupSelector, Func <G, IWithCubeGroup> undesiredGroupSelector) { return(AllRows .Where(r => desiredGroupSelector(r) != null && undesiredGroupSelector(r) == null) .ToDictionary(r => desiredGroupSelector(r).Value, r => r.Aggregate)); }