This project is read-only.
1
Vote

Error in sort

description

SortToString in Google.Analytics.Model.Queries.DataQuery creates wrong string, when SortDirection is Descending (minus on wrong place)
 
Correction:
private static string SortToString(IEnumerable<Order> orders)
    {
        var str = new StringBuilder();
        foreach (var order in orders)
        {
            string orderString = order.ToString().ToLowerInvariant();
            str.AppendFormat("{0}ga:{1},", (orderString.StartsWith("-") ? "-" : ""), (orderString.StartsWith("-") ? orderString.Substring(1) : orderString));
        }
        return str.ToString(0, str.Length - 1);
    }

comments