SortReversed Property

Gets or sets the value determining wether to reverse the order of the rows returned by the task

Definition

Namespace: Firefly.Box
Assembly: Firefly.Box (in Firefly.Box.dll) Version: debug-master-v:33791
C#
public bool Reversed { get; set; }

Property Value

Boolean

Example

This example demonstrates the usage of ReversedSort
This example is in the form of Unit Tests. It references the NUnit framework. This framework can be downloaded from www.NUnit.org. For more information about unit testing visit: www.NUnit.org.
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
C#
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Firefly.Box;
using Firefly.Box.Testing;

namespace TestFirefly.Box.Documentation
{
    [TestFixture]
    public class ReversedSort
    {
        [Test]
        public void ReversedSortExample()
        {
            string jobTitles = "";
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();

            var bp = new BusinessProcess
            {
                From = jobs
            };

            bp.OrderBy.Segments.Add(jobs.MinLevel); // Uses the segment property

            bp.ForEachRow(() => jobTitles += jobs.MinLevel.ToString().Trim() + ",");

            jobTitles.ShouldBe("10,25,25,25,75,75,75,100,120,140,150,175,175,200,");

            bp.OrderBy.Reversed = true;

            jobTitles = "";

            bp.ForEachRow(() => jobTitles += jobs.MinLevel.ToString().Trim() + ",");

            jobTitles.ShouldBe("200,175,175,150,140,120,100,75,75,75,25,25,25,10,");
        }
    }
}

See Also