Slicing - gravbox/Gravitybox.Datastore GitHub Wiki

A novel piece of functionality is slicing. A slice is defined as a set of fields and a single dimension on which ot pivot. Using the slice dimension, all possible values of that dimension are used to create a 2-D graph. Each of the defined fields are plotted against each dimension value. This is functionally equivalent to running multiple SQL queries. The query algorithm would be finding every value of the splice dimension and looping through each. For each value run a query with the dimension value used as an additional where clause and group by all of the defined splice fields. The information returned is a 2-D graph of each dimension value. This becomes a 3-D graph if thought of as a stack of 2-D graphs.

var results = repository.Slice .Where(x => x.ProjectId == "1") .PageOffset(page) .RecordsPerPage(PAGE_SIZE) .GroupField(x => x.Project) .GroupField(x => x.ProjectVersion) .SliceDimension(x => x.ClosedStatus) .OrderBy(x => x.ProjectVersion) .ToSlice();