/** * Adds the given projection. * * @param projection the projection to add * @return this */ public IExitOperationsCollector AddProjection(IProjection projection) { if (projection.GetType().IsAssignableFrom(distinct.GetType())) { this.distinct = (Distinct)projection; //TODO: Distinct doesn't work yet log.Error("Distinct is not ready yet"); throw new NotSupportedException(); } if (projection.GetType().IsAssignableFrom(rowCountProjection.GetType())) { rowCountProjection = (RowCountProjection)projection; } if (projection.GetType().IsAssignableFrom(aggregateProjection.GetType())) { if (projection.ToString().ToLower().StartsWith("avg")) { this.avgProjection = (AggregateProjection)projection; } else { this.aggregateProjection = (AggregateProjection)projection; } } else { log.Error("Adding an unsupported Projection: " + projection.GetType().Name); throw new NotSupportedException(); } return(this); }