Пример #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_update_entity()
        {
            var log = new Log()
            {
                Identifier      = Guid.NewGuid(),
                CreateTime      = DateTime.Now,
                UpdateTimeTicks = DateTime.Now,
                Message         = nameof(this.Test_insert_default_value_sql_PK_has_value),
            };

            DapperExtension.Insert(log);
            log.UpdateTimeTicks = DateTime.Now;
            log.Message         = nameof(this.Test_update_entity);
            int count = DapperExtension.Update(log);

            Assert.Equal(1, count);
        }