Esempio n. 1
0
        public void OrderStrTest()
        {
            var condition = new QueryCondition <Vendor>();

            condition.AddSort("Number", "DESC");

            var vendors = GetTestList();
            var query   = vendors.AsQueryable().OrderBy(condition.Sorts.ConvertToSortString());

            var data = query.ToList();

            Assert.NotNull(data);
            Assert.True(data.Count == 2);
            Assert.True(data[0].Name == "AB");
            Assert.True(data[0].Number == vendors[1].Number);
            Assert.True(data[1].Name == "ABC");
            Assert.True(data[1].Number == vendors[0].Number);
        }