public SLORMContext Sum(string columnName)
        {
            var column = ColumnsInTable.GetFromName(columnName);

            if (column == null || column.DataType != ColumnDataType.Number)
            {
                return(this);
            }

            var columnAlreadyInList = ColumnsToSum.GetFromName(column.Name) != null;

            if (columnAlreadyInList)
            {
                return(this);
            }

            ColumnsToSum.Add(column);
            return(this);
        }
        public SLORMContext OrderBy(ColumnOrderingRequest orderingRequest)
        {
            var column = ColumnsInTable.GetFromName(orderingRequest.ColumnName);

            if (column == null)
            {
                return(this);
            }

            var alreadyGroupedByColumn = ColumnsToGroupBy.GetFromName(column.Name) != null ||
                                         ColumnsToSum.GetFromName(column.Name) != null ||
                                         ColumnsToCount.GetFromName(column.Name) != null;

            if (!alreadyGroupedByColumn)
            {
                GroupBy(column.Name);
            }

            var columnOrdering = new ColumnOrdering(column, orderingRequest);

            ColumnsToOrderBy.Add(columnOrdering);

            return(this);
        }