Beispiel #1
0
 /// <summary>
 /// Run analysis an all data.
 /// Data will be grouped by specified dimensions.
 /// Aggregation will be run on specified facts.
 /// Data will be returned in specified order.
 /// </summary>
 /// <param name="query">cube query</param>
 /// <param name="dimensions">dimension subset</param>
 /// <param name="facts">fact subset</param>
 /// <param name="order">custom order</param>
 /// <param name="limit">maximum number of row</param>
 /// <param name="offset">how many initial rows to skip</param>
 /// <returns>result from created query</returns>
 public static DataTable Analyze <T>(
     this IOlapCubeQuery <T> query,
     IEnumerable <string> dimensions,
     IEnumerable <string> facts,
     IEnumerable <KeyValuePair <string, bool> > order,
     int?limit,
     int?offset) where T : IDataSource
 {
     return(query.Analyze(dimensions, facts, order, null, limit, offset));
 }
Beispiel #2
0
 /// <summary>
 /// Run analysis an all data.
 /// Data will be grouped by specified dimensions.
 /// Aggregation will be run on specified facts.
 /// Data will be returned in specified order.
 /// </summary>
 /// <param name="query">cube query</param>
 /// <param name="dimensions">dimension subset</param>
 /// <param name="facts">fact subset</param>
 /// <param name="order">custom order</param>
 /// <param name="limit">maximum number of row</param>
 /// <param name="offset">how many initial rows to skip</param>
 /// <returns>result from created query</returns>
 public static DataTable Analyze(
     this IOlapCubeQuery query,
     IEnumerable <string> dimensions,
     IEnumerable <string> facts,
     IEnumerable <KeyValuePair <string, bool> > order,
     int?limit,
     int?offset)
 {
     return(query.Analyze <object>(dimensions, facts, order, null, limit, offset));
 }
Beispiel #3
0
            public DataTable Analyze <TFormat>(
                ISerialization <TFormat> serializer,
                IServiceLocator locator,
                IOlapCubeQuery query,
                IEnumerable <string> dimensions,
                IEnumerable <string> facts,
                IDictionary <string, bool> order,
                int?limit,
                int?offset,
                TFormat data)
            {
                dynamic specification;

                if (data == null)
                {
                    try
                    {
                        specification = Activator.CreateInstance(typeof(TSpecification));
                    }
                    catch (Exception ex)
                    {
                        throw new ArgumentException("Specification can't be created. It must be sent as argument.", ex);
                    }
                }
                else
                {
                    try
                    {
                        specification = serializer.Deserialize <TFormat, TSpecification>(data, locator);
                    }
                    catch (Exception ex)
                    {
                        throw new ArgumentException("Specification could not be deserialized.", ex);
                    }
                }
                if (specification == null)
                {
                    throw new FrameworkException("Specification could not be deserialized.");
                }
                return(query.Analyze(dimensions, facts, order, specification, limit, offset));
            }
Beispiel #4
0
 /// <summary>
 /// Original OLAP cube query.
 /// </summary>
 /// <param name="query">OLAP cube query</param>
 public OlapCubeQueryBuilder(IOlapCubeQuery <T> query)
 {
     this.Query = query;
 }
Beispiel #5
0
 /// <summary>
 /// Create OLAP cube builder with fluent API.
 /// </summary>
 /// <param name="query">OLAP cube</param>
 /// <returns>builder</returns>
 public static OlapCubeQueryBuilder <T> Builder <T>(this IOlapCubeQuery <T> query)
     where T : IDataSource
 {
     return(new OlapCubeQueryBuilder <T>(query));
 }
Beispiel #6
0
 /// <summary>
 /// Create OLAP cube builder with fluent API.
 /// </summary>
 /// <param name="query">OLAP cube</param>
 /// <returns>builder</returns>
 public static OlapCubeQueryBuilder Builder(this IOlapCubeQuery query)
 {
     return(new OlapCubeQueryBuilder(query));
 }