コード例 #1
0
        public void Count_WhereSpecification_FromNameValuePairs()
        {
            var soh   = new SalesOrderHeaders();
            var total = soh.Count(new { CustomerID = 11212, ModifiedDate = new DateTime(2013, 10, 10) });

            Assert.AreEqual(2, total);
        }
コード例 #2
0
        public void Count_TestWhereWrapping()
        {
            dynamic soh   = new SalesOrderHeaders();
            var     total = soh.Count(where : "1=1 OR 0=0", CustomerID: 11212);

            Assert.AreEqual(17, total);
        }
コード例 #3
0
        public void Count_WhereSpecification_FromArgs()
        {
            var soh   = new SalesOrderHeaders();
            var total = soh.Count(where : "WHERE CustomerId=@0", args: 11212);

            Assert.AreEqual(17, total);
        }
コード例 #4
0
        public void Count_WhereSpecification_FromArgsPlusNameValue()
        {
            dynamic soh   = new SalesOrderHeaders();
            var     total = soh.Count(where : "WHERE CustomerId=@0", args: 11212, ModifiedDate: new DateTime(2013, 10, 10));

            Assert.AreEqual(2, total);
        }
コード例 #5
0
        public void Count_NoSpecification()
        {
            var soh   = new SalesOrderHeaders();
            var total = soh.Count();

            Assert.AreEqual(31465, total);
        }