public void ReturnMultipleDescendingPropertiesTest() { var expected = "name desc,follows desc"; Expression <Func <GameShort, object> > predicate = g => new { g.Name, g.Follows }; Assert.AreEqual(expected, InvertedOrderByInterpreter.Run(predicate.Body, configuration)); }
/// <summary> /// Adds one or multiple <em>order by descending</em> statements to the order by clause of /// the API.<br/> /// Each call adds a statement to the orders clause<br/> /// Prepares the <strong>orders</strong> statement of the Apicalypse query. /// </summary> /// <param name="predicate">A predicate expression that provides a list of fields or a single fields</param> /// <returns>The request builder, to chain the statements</returns> public RequestBuilder <T> OrderByDescending(Expression <Func <T, object> > predicate) { if (!string.IsNullOrEmpty(orders)) { orders += ","; } orders += InvertedOrderByInterpreter.Run(predicate.Body, configuration); return(this); }