private FullPipelineRow GetFullPipelineRow(IDataReader reader, FullPipelineEntityConfig config)
        {
            var pipelineRow = new FullPipelineRow {
                StageId      = reader.GetColumnValue <Guid>("StageId"),
                CountInStage = reader.GetColumnValue <decimal>(FullPipelineQueryConsts.CurrentInStageCountColumnName),
                OverallCount = reader.GetColumnValue <decimal>(FullPipelineQueryConsts.OverallStageCountColumnName)
            };
            var calcProperties = GetCalculatedProperties(reader, config);

            pipelineRow.CalculatedProperties = calcProperties;
            return(pipelineRow);
        }
        private IEnumerable <FullPipelineRow> ExecuteQuery(Select query, FullPipelineEntityConfig config)
        {
            var result = new List <FullPipelineRow>();

            using (var dbExecutor = _userConnection.EnsureDBConnection(QueryKind.Limited)) {
                using (var reader = query.ExecuteReader(dbExecutor)) {
                    while (reader.Read())
                    {
                        var pipelineRow = GetFullPipelineRow(reader, config);
                        result.Add(pipelineRow);
                    }
                }
            }
            return(result);
        }
 private Dictionary <string, decimal> GetCalculatedProperties(IDataReader reader, FullPipelineEntityConfig config)
 {
     if (config.CalculatedOperations.IsEmpty())
     {
         return(null);
     }
     return(config.CalculatedOperations
            .ToDictionary(operation => operation.Operation,
                          operation => reader.GetColumnValue <decimal>(operation.Operation)));
 }