Ejemplo n.º 1
0
        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))));
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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));
 }