Beispiel #1
0
        public void TestUpdateModelField()
        {
            var repository = new Repository <DictInfo>(Conn);
            var ddxx       = new DictInfo()
            {
                DictID     = 106091,
                CreateTime = DateTime.Now,
                Remark     = "PHP是最好的语言"
            };
            var rst = repository.Update(ddxx, x => x.CreateTime, x => x.Remark);

            Assert.Equal(1, rst);
            var ddyy = repository.Find(106091);

            Assert.Equal("PHP是最好的语言", ddyy.Remark);
        }
Beispiel #2
0
        public void TestUpdateNotDefault()
        {
            var repository = new Repository <DictInfo>(Conn);
            var ddxx       = new DictInfo()
            {
                DictID     = 106092,
                CreateTime = DateTime.Now,
                DictType   = null,
                DictName   = "某层某层会议室",
                Remark     = null,
                Deleted    = false,
                OrderNum   = OrderEnum.optionB
            };
            var rst = repository.UpdateNotDefault(ddxx);

            Assert.Equal(1, rst);
            var ddyy = repository.Find(106092);

            Assert.Equal("今天交流的内容是DapperEx使用", ddyy.Remark);
        }