Example #1
0
        public async Task test()
        {
            var pk   = Guid.Parse("8f2cbb64-8356-4482-88ee-016558c05b2d");
            var date = DateTime.Parse("2018-08-20 19:12:05.933786");

            /****************************************************************************************/

            var xx4 = "";

            var res4 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(it => it.Id == pk && it.CreatedOn == date,
                                                                                                   it => new AlipayPaymentRecordVM
            {
                Id          = it.Id,
                TotalAmount = it.TotalAmount,
                Description = it.Description
            });

            Assert.NotNull(res4);

            var tuple4 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx5 = "";

            var res5 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(it => it.Id == pk && it.CreatedOn == date);

            Assert.NotNull(res5);

            var tuple5 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx6 = "";

            var res6 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord>(it => it.Id == pk && it.CreatedOn == date);

            Assert.NotNull(res6);

            var tuple6 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx7 = "";

            var option7 = new AlipayPaymentQueryOption();

            option7.CreatedOn = date;
            var res7 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord>(option7);

            Assert.True(res7.Id == pk);

            var tuple7 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx8 = "";

            var res8 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(option7);

            Assert.True(res8.Id == pk);

            var tuple8 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx9 = "";

            var res9 = await Conn.FirstOrDefaultAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(option7, record => new AlipayPaymentRecordVM
            {
                Id          = record.Id,
                TotalAmount = record.TotalAmount,
                Description = record.Description
            });

            Assert.True(res9.Id == pk);

            var tuple9 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx = "";
        }
Example #2
0
        public async Task test()
        {
            /****************************************************************************************/

            var xx1 = "";

            var date = DateTime.Parse("2018-08-20");
            var res1 = await Conn.ListAsync <AlipayPaymentRecord>(it => it.CreatedOn >= date);

            Assert.True(res1.Count == 29);

            var tuple1 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx2 = "";

            var res2 = await Conn.ListAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(it => it.CreatedOn >= date);

            Assert.True(res1.Count == 29);

            var tuple2 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx3 = "";

            var res3 = await Conn.ListAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(it => it.CreatedOn >= date,
                                                                                         it => new AlipayPaymentRecordVM
            {
                TotalAmount = it.TotalAmount,
                Description = it.Description
            });

            Assert.True(res3.Count == 29);

            var tuple3 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx4 = "";

            var option4 = new AlipayPaymentQueryOption();

            option4.StartTime = date;
            var res4 = await Conn.ListAsync <AlipayPaymentRecord>(option4);

            Assert.True(res4.Count == 29);

            var tuple4 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx5 = "";

            var res5 = await Conn.ListAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(option4);

            Assert.True(res4.Count == 29);

            var tuple5 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/

            var xx6 = "";

            var res6 = await Conn.ListAsync <AlipayPaymentRecord, AlipayPaymentRecordVM>(option4,
                                                                                         record => new AlipayPaymentRecordVM
            {
                TotalAmount = record.TotalAmount,
                Description = record.Description
            });

            Assert.True(res4.Count == 29);

            var tuple6 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/
        }