Esempio n. 1
0
        public void Exec_ScalarListGuid() {
            SubSonic.SqlQuery q = new
                Select(Product.ProductGUIDColumn)
                .From(Product.Schema)
                .OrderAsc(Product.ProductIDColumn.QualifiedName);

            List<Guid> lst = q.ExecuteScalarList<Guid>();
            Assert.AreEqual(new Guid("52c7760f-6b66-46e7-a99b-67cf142f2a6c"), lst[0]);
            Assert.AreEqual(77, lst.Count);
        }
Esempio n. 2
0
        public void Exec_ScalarListShort() {
            SubSonic.SqlQuery q = new
                Select(Product.UnitsInStockColumn)
                .From(Product.Schema)
                .OrderAsc(Product.ProductIDColumn.QualifiedName);

            List<short> lst = q.ExecuteScalarList<short>();
            Assert.AreEqual(39, lst[0]);
            Assert.AreEqual(77, lst.Count);
        }
Esempio n. 3
0
        public void Exec_ScalarListString() {
            SubSonic.SqlQuery q = new
                Select(Product.ProductNameColumn)
                .From(Product.Schema)
                .OrderAsc(Product.ProductIDColumn.QualifiedName);

            List<string> lst = q.ExecuteScalarList<string>();
            Assert.AreEqual("Chai", lst[0]);
            Assert.AreEqual(77, lst.Count);
        }