示例#1
0
        public void Test_update_entity_with_self_increase_PK()
        {
            var student = DapperExtension.FirstOrDefault <Student>();

            if (student != null)
            {
                student.Name = "update";
                int count = DapperExtension.Update(student);
                Assert.Equal(1, count);
            }
        }
示例#2
0
        public void Test_DateTimeToTicksConverter()
        {
            var log = new Log
            {
                Message         = nameof(this.Test_DateTimeToTicksConverter),
                UpdateTimeTicks = DateTime.Now,
            };

            int count = DapperExtension.Insert(log);

            Assert.Equal(1, count);

            log = DapperExtension.FirstOrDefault <Log>();
        }
示例#3
0
        public void Test_UriToStringConverter(string url)
        {
            var log = new Log
            {
                Message         = url,
                UpdateTimeTicks = DateTime.Now,
                Url             = url == null ? null : new Uri(url),
            };

            int count = DapperExtension.Insert(log);

            Assert.Equal(1, count);

            log = DapperExtension.FirstOrDefault <Log>();
        }
示例#4
0
        public void Test_BoolToZeroOneConverter()
        {
            var course = new Course
            {
                Name       = "insert",
                UpdateTime = DateTime.Now,
                CreateTime = DateTime.Now,
                IsDeleted  = true,
            };

            int count = DapperExtension.Insert(course);

            Assert.Equal(1, count);

            course = DapperExtension.FirstOrDefault <Course>();
        }
示例#5
0
 public void Test_select_from_view()
 {
     var log = DapperExtension.FirstOrDefault <VLog>();
 }