示例#1
0
        public void ShouldPerformActionToEachRow()
        {
            var sql = new DynamicSql(connectionString);

            sql.EachRow("select * from Customers order by CustomerID",
                r => Console.WriteLine("{0} - {1}", r.CompanyName, r.ContactName));

            decimal total = 0.0m;

            sql.EachRow("select * from [Order Details] where OrderID = 10251",
                r => total += r.Quantity * r.UnitPrice * (decimal)(1 - r.Discount));

            Assert.AreEqual(654.06m, total);
        }
示例#2
0
        public void SmokeTest()
        {
            var sql = new DynamicSql(connectionString);

            sql.EachRow("select * from Customers order by CustomerID",
                r => Console.WriteLine("{0} - {1}", r.CompanyName, r.ContactName));
        }